Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3: @template variable inside controllers is nil

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

like image 678
Pioz Avatar asked Jul 21 '10 14:07

Pioz


1 Answers

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

like image 65
Dmitry Naumov Avatar answered Oct 02 '22 11:10

Dmitry Naumov