Hi, I''m receiving this pretty standard error message: undefined local variable or method `session'' for ApplicantHelper::Filter:Class 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? Thanks, Michael --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Henry wrote:> Hi, > > I''m receiving this pretty standard error message: > > undefined local variable or method `session'' for ApplicantHelper::Filter:Class > > > 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?Pass it in as a parameter to the method. -- Michael Wang --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 On Apr 13, 9:54 am, Michael Henry <michael.k.he...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I''m receiving this pretty standard error message: > > undefined local variable or method `session'' for ApplicantHelper::Filter:Class > > 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? > > Thanks, > > Michael--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Reasonably Related Threads
- Access url_for from rake task
- How to access text helper and url helper methods in model
- Using view helpers and route helpers in a model
- ActionController <-> ActiveView code access ambiguity
- help - updated from 1.2.5 to 1.2.6 and getting undefined method 'session=' for ActionController::base