开发者

What is this inside an erb template [Rails]

开发者 https://www.devze.com 2023-01-06 18:21 出处:网络
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 help

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

精彩评论

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