开发者

Output the name of the view being rendered in rails 3.1

开发者 https://www.devze.com 2023-04-12 19:26 出处:网络
How does this translate to Rails 3.1? @template.instance_variable_get(:@_first_render).name It\'s supposed to output the name of the view being rendered. Note: it\'s not always the same as params开

How does this translate to Rails 3.1?

@template.instance_variable_get(:@_first_render).name

It's supposed to output the name of the view being rendered. Note: it's not always the same as params开发者_StackOverflow[:action]

Thanks!


You can find one great answer for Rails 3.0.X here.

There is another for Rails 3.1.x but I tried it without success.

0

精彩评论

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

关注公众号