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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Jul 2, 2008, at 10:10 AM, Mitchell Gould wrote:> > > > > > 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> > > Thank you for your time in advance. > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Breen wrote:> On Jul 2, 2008, at 10:10 AM, Mitchell Gould 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, > http://api.rubyonrails.org/classes/ActionController/Base.html > > Best. > MikeThanks Mike, I will look into this. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---