i've started using rails 3 beta3 and I have see that the @template variable inside controllers is nil. How I can call helpers methods inside a controller? Thx
Dmitry Naumov
Use the view_context
method instead of @template
.
This is because in Rails 3 the new AbstractController
was introduced.
You can read more here:
http://apidock.com/rails/AbstractController/Rendering/view_context
来源:https://stackoverflow.com/questions/3300582/rails-3-template-variable-inside-controllers-is-nil