Output the name of the view being rendered in rails 3.1
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.
精彩评论