Return to Request Page after login

I have a login form on the left column of a site I am building. The
user can visit any page and the form is always present on the left. The
middle column of the site is used for the display of site information
etc.

My question.

Once the user logs in how to I direct them back to the page they were
viewing at the time of registration since it could be any page in the
site?

Thank you for your time in advance.

On Jul 2, 2008, at 10:10 AM, Mitchell G. wrote:

My question.

Once the user logs in how to I direct them back to the page they were
viewing at the time of registration since it could be any page in the
site?

redirect_to :back

check the API for more detail,

Best.
Mike

Store the last action in a session variable.
store using
session[:action] = :action_name_to_Return_to
before login

On the return page,
you can do something like redirect_to :action = session[:action] ||
= :default_action

arun

On Jul 2, 10:10 am, Mitchell G. [email protected]

Arun Gokule wrote:

Store the last action in a session variable.
store using
session[:action] = :action_name_to_Return_to
before login

On the return page,
you can do something like redirect_to :action = session[:action] ||
= :default_action

arun

On Jul 2, 10:10�am, Mitchell G. [email protected]

Great I will try this and get back to you

Michael B. wrote:

On Jul 2, 2008, at 10:10 AM, Mitchell G. wrote:

My question.

Once the user logs in how to I direct them back to the page they were
viewing at the time of registration since it could be any page in the
site?

redirect_to :back

check the API for more detail,
ActionController::Base

Best.
Mike

Thanks Mike,
I will look into this.