Rails 3.1.3
I’m having difficulty understanding ‘session’, which is a way to
maintain some data even when the page reloaded (or jumped and came
back), if I understand it correctly.
Basically, what I wanna do is to simply keep an integer value, stored as
an instance variable, after jumping to another page and coming back to
where I was. But do so, by passing the value from one action to
another.
say I have an action,
def jump_to
@order = 1234
session[:value] = @order
end
this action, ‘jump_to’, redirects to a different page(different domain),
from which one can come back to the original domain but a new page,
having the action
def come_back
@order = session[:value]
end
But @order seems empty. Maybe I am not defining the session value
properly.
Could anyone help me out?
soichi