Rails 3:控制器内部的@template变量为零

Pio*_*ioz 8 templates helpers ruby-on-rails-3

我已经开始使用rails 3 beta3了,我发现控制器内的@template变量是零.如何在控制器内调用助手方法?谢谢

Dmi*_*mov 25

使用该view_context方法代替@template.

这是因为在Rails 3 AbstractController中引入了新的.

你可以在这里阅读更多:

http://apidock.com/rails/AbstractController/Rendering/view_context