you can use session only in your views and controllers.
since a session is basically a hash that holds a value, for example
your session[:user_id] = some integer.
So in rails console, you can simply pass a value that you method
expects.
lets say you have a method called find_user_data(session[:user_id)
that expects a session[:user_id]
in the console, instead of calling it like
find_user_data(session[:user_id) you can simply call this as
find_user_data(1)
On Nov 7, 1:02 am, salj
<salem.m.ja...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I am trying to debug my application using ruby script/console. Once I
> am in the console, I type session[:user_id] and I get and undefined
> local variable error. If I use a view to post the session[:user_id], I
> get no error. Any idea why this is happening. Help is greatly
> appreciated.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---