开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜