randombits
randombits

Reputation: 48440

What is this inside an erb template [Rails]

I'm seeing code like this inside of an erb template:

<% hook :admin_footer_scripts do -%>

What exactly is hook? is it a standard method within ActionView?

Upvotes: 0

Views: 141

Answers (2)

thomasfedb
thomasfedb

Reputation: 5983

Just from what it looks like I'd say it's a way to allow the controller to add code the the page. But bgj is right. Look in your helper files.

Upvotes: 0

bjg
bjg

Reputation: 7477

It's probably a helper method defined in your application. Look in app/helpers/application.rb or in the app/helpers/ directory for a ruby file named like the controller which renders that view

Upvotes: 2

Related Questions