Forum: Ruby on Rails Can't access session from helper?!

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Michael H. (Guest)
on 2007-04-13 05:56
(Received via mailing list)

I'm receiving this pretty standard error message:

undefined local variable or method `session' for

All my searches have returned results where the developer is trying to
access the session from the model. In this case, it's just a helper
class. Do I have to inherit from ActionController::Base and therefore
make the helper a controller? Is there another way?


Michael W. (Guest)
on 2007-04-13 07:48
(Received via mailing list)
Michael H. wrote:
> make the helper a controller? Is there another way?
Pass it in as a parameter to the method.

Michael W.
Eden L. (Guest)
on 2007-04-15 13:48
(Received via mailing list)
You should have access to everything in your controller from the
helper.  It looks as though you're trying to access session from a
submodule of the helper which could be a problem.

Maybe you could try adding this to your controller:

helper ApplicantHelper::Filter
This topic is locked and can not be replied to.