Forum: Ruby on Rails redirect_to an uncertain hash

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Aa33613fb12765fe505efea87844a12e?d=identicon&s=25 Craig White (Guest)
on 2007-04-02 20:08
(Received via mailing list)
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

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}"

Of course there are values that are obvious such as

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 White <>
27c170f482104299af279902be0a9c26?d=identicon&s=25 Trevor Squires (Guest)
on 2007-04-02 20:42
(Received via mailing list)

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]

Aa33613fb12765fe505efea87844a12e?d=identicon&s=25 Craig White (Guest)
on 2007-04-04 00:48
(Received via mailing list)
My - that was much simpler...thanks


On Mon, 2007-04-02 at 11:39 -0700, Trevor Squires wrote:
> Trevor
> >   session[:direct_to] = @params
> > Of course there are values that are obvious such as
> >
> >
> >
> >
Craig White <>
This topic is locked and can not be replied to.