How do I figure out what page a user came from before landing on the sign-up page? :-) Thanks.
On 25.5.2005, at 20:50, John Kopanas wrote:> How do I figure out what page a user came from before landing on the > sign-up page? :-)Do this before redirecting to the login page: @session[:return_to] = @request.request_uri You can then use the session variable to redirect the user back to the right place after she has has logged in. //jarkko> > Thanks. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Jarkko Laine http://jlaine.net http://odesign.fi _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Is there a way to easily find out the controller and action of the page that the user was on before he/she landed on the sign-up page? On 25-May-05, at 1:54 PM, Jarkko Laine wrote:> On 25.5.2005, at 20:50, John Kopanas wrote: > > >> How do I figure out what page a user came from before landing on >> the sign-up page? :-) >> > > Do this before redirecting to the login page: > > @session[:return_to] = @request.request_uri > > You can then use the session variable to redirect the user back to > the right place after she has has logged in. > > //jarkko > > >> >> Thanks. >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > -- > Jarkko Laine > http://jlaine.net > http://odesign.fi > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On May 25, 2005, at 3:06 PM, John Kopanas wrote:> Is there a way to easily find out the controller and action of the > page that the user was on before he/she landed on the sign-up page?The only way I know of currently is tracking the last page with a before_filter for every action putting it into session scope as shown below. Erik> > On 25-May-05, at 1:54 PM, Jarkko Laine wrote: > > >> On 25.5.2005, at 20:50, John Kopanas wrote: >> >> >> >>> How do I figure out what page a user came from before landing on >>> the sign-up page? :-) >>> >>> >> >> Do this before redirecting to the login page: >> >> @session[:return_to] = @request.request_uri >> >> You can then use the session variable to redirect the user back to >> the right place after she has has logged in. >> >> //jarkko >> >> >> >>> >>> Thanks. >>> _______________________________________________ >>> Rails mailing list >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >>> >>> >> -- >> Jarkko Laine >> http://jlaine.net >> http://odesign.fi >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
You can also use the HTTP_REFERER header field which most browsers now set. John-Mason Shackelford Software Developer Pearson Educational Measurement 2510 North Dodge St. Iowa City, IA 52245 ph. 319-354-9200x6214 john-mason.shackelford-uJfvbxoDSvxBDgjK7y7TUQ@public.gmane.org http://pearsonedmeasurement.com