storing whole objects in session isn't usually a good recommendation...
the best solution would probably be to pass just the object's id and
then retrieve it from the database/wherever in your requested action
another approach could be to serialize the object and deserialize it
at the server. however, if you just need to pass a hash or something
like that, you could use the json notation to pass the data
maybe you can save object to session and send a flag to get the object?
Thanks a lot for the hint. The idea seems very nice. However, I can't
get it working. I'm using the Facebooker plugin, maybe it messes up with
sessions.
in my index method of the main controller, I create the session
variable:
session[:me] = @me
then in another method I try to use print it's contents:
print "\n" + session[:me].account_id.to_s
However, I get an error: "You have a nil object when you didn't expect
it!"
So the variable is not preserved in the session. Am I doing something
wrong with storing/retrieving the session objects?