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.

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?

redirect_to :back

check the API for more detail, http://api.rubyonrails.org/classes/ActionController/Base.html

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

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 Gould <rails-mailing-l...@andreas-s.net>

Great I will try this and get back to you

Michael Breen wrote: