开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜