The session only matters for controllers and views. The models don''t
have access to the session hash unless you explicitly pass variables
in.
It looks like you are mixing up controller logic from model logic.
-Danimal
On Apr 15, 9:34 am, Fabio
<fabio.barre...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hii guys!
>
> I''m new to ROR...
> I have a helpter in my rails APP with 2 classes inside it
>
> There''s a method that needs to set a session variable, but
I''m getting
> an error
> def send_upload_request(entry)
> .
> .
> some code here
> .
> .
> xmldoc = XmlSimple.xml_in(data)
> @upload_token = xmldoc[''token''].to_s
> @upload_url = xmldoc[''url''].to_s
> session["upload_token"] = @upload_token # here raises
the
> error
> session["upload_url"] = @upload_url
> end
>
> I''m getting the following error message:
>
> undefined local variable or method `session'' for
> #<ModuleName::ClassName
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---