[Rails] "Remembering" link to redirect to after logging in

Woei Shyang woeishyang at gmail.com
Tue Mar 21 10:36:01 GMT 2006


Hi,

Suppose I have a resource such as http://localhost:3000/topsecret/data 
that requires the user to login first.

What I did was make use of before_filter to check and see if the session 
variable is set with the logged in user's id (similar to the example in 
"Agile Web Development with Rails").

However while the filtering function does work correctly in redirecting 
the user to the login page, how do I actually capture the original 
request made by the user so that I can redirect the user back to the 
required resource after s/he has logged in?

Thanks!

-- 
Posted via http://www.ruby-forum.com/.


More information about the Rails mailing list