Redirect_to an uncertain hash

I am trying to deal with a redirection based upon what to do after a
session has expired. I take the params hash and stuff it into a new
session as part of the new login and then after login, I want to
redirect to this hash as though they were params again…

Thus I start by setting
session[:direct_to] = @params

And after I login, I want to redirect based upon the values in
session[:direct_to]…

What I am trying to do is this but I keep getting syntax errors…

 redirect_to (session[:direct_to].each do |key, value|
   "#{key} => #{value}"
   end)

Of course there are values that are obvious such as
session[:direct_to][:controller]
session[:direct_to][:action]

but there are a lot of other params that may or may not be included so I
am trying to abstract and recover them in my redirect_to statement. Is
there a way that I can do this?


Craig W. [email protected]

Hey,

rather than store the params hash in the session, why not just store
the actual redirection url?

session[:direct_to] = url_for(params)

redirect_to session[:direct_to]

HTH
Trevor

My - that was much simpler…thanks

Craig

On Mon, 2007-04-02 at 11:39 -0700, Trevor S. wrote:

Trevor

session[:direct_to] = @params
Of course there are values that are obvious such as


Craig W. [email protected]