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 s开发者_JAVA百科tandard method within ActionView?
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
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.
精彩评论