Are there any best practices for implementing a back/cancel/return button... even when the page you want to return people too is 2 pages back (when people submit form and then want to return)? Thanks :-) Your Friend, John Kopanas http://www.kopanas.com ====================================================================http://www.soen.info - source of the freshest software engineering information on the net http://cusec.soen.info - software engineering conference
Hey John ! I just use the session[], and keep track of the pages... etc. I think that is about the best way to do it as far as I know. Just did this this morning :) On 2/14/06, John Kopanas <john@protoseinc.com> wrote:> > Are there any best practices for implementing a back/cancel/return > button... even when the page you want to return people too is 2 pages > back (when people submit form and then want to return)? > > Thanks :-) > > Your Friend, > > John Kopanas > http://www.kopanas.com > > > ====================================================================> http://www.soen.info - source of the freshest software engineering > information on the net > http://cusec.soen.info - software engineering conference > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060215/1cc2c649/attachment-0001.html
What variable do you use to get the page? On 14-Feb-06, at 7:05 PM, Dylan Stamat wrote:> Hey John ! I just use the session[], and keep track of the > pages... etc. > I think that is about the best way to do it as far as I know. Just > did this this morning :) > > > On 2/14/06, John Kopanas <john@protoseinc.com> wrote: Are there any > best practices for implementing a back/cancel/return > button... even when the page you want to return people too is 2 pages > back (when people submit form and then want to return)? > > Thanks :-) > > Your Friend, > > John Kopanas > http://www.kopanas.com > > > ====================================================================> http://www.soen.info - source of the freshest software engineering > information on the net > http://cusec.soen.info - software engineering conference > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/railsJohn Kopanas http://www.kopanas.com ====================================================================http://www.soen.info - source of the freshest software engineering information on the net http://cusec.soen.info - software engineering conference
none. when im on the first page of the form, i set something new in the session, like: session[:user_reg_first], with an arbitrary value. when they get to the second page, i do the same but with session[:user_reg_second]...etc...etc. if someone is on the first page, and tries to go to the third, i make sure they have a valid entry in session[:user_reg_third], if they don''t, I check session[:user_reg_second]...etc i think you get the idea. it''s a verbose method... but it works for me :) On 2/14/06, John Kopanas <john@protoseinc.com> wrote:> > What variable do you use to get the page? > > On 14-Feb-06, at 7:05 PM, Dylan Stamat wrote: > > > Hey John ! I just use the session[], and keep track of the > > pages... etc. > > I think that is about the best way to do it as far as I know. Just > > did this this morning :) > > > > > > On 2/14/06, John Kopanas <john@protoseinc.com> wrote: Are there any > > best practices for implementing a back/cancel/return > > button... even when the page you want to return people too is 2 pages > > back (when people submit form and then want to return)? > > > > Thanks :-) > > > > Your Friend, > > > > John Kopanas > > http://www.kopanas.com > > > > > > ====================================================================> > http://www.soen.info - source of the freshest software engineering > > information on the net > > http://cusec.soen.info - software engineering conference > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > John Kopanas > http://www.kopanas.com > > > ====================================================================> http://www.soen.info - source of the freshest software engineering > information on the net > http://cusec.soen.info - software engineering conference > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060215/77c0309c/attachment.html
Wow... that is crazy :-). For now I am going with: <%= link_to "return without loging-in", "javascript:history.back()" %> Unless someone has better suggestions :-). On 14-Feb-06, at 7:34 PM, Dylan Stamat wrote:> none. when im on the first page of the form, i set something new > in the session, like: session[:user_reg_first], with an arbitrary > value. when they get to the second page, i do the same but with > session[:user_reg_second]...etc...etc. > if someone is on the first page, and tries to go to the third, i > make sure they have a valid entry in session[:user_reg_third], if > they don''t, I check session[:user_reg_second]...etc > > i think you get the idea. it''s a verbose method... but it works > for me :) > > > > On 2/14/06, John Kopanas <john@protoseinc.com> wrote: What variable > do you use to get the page? > > On 14-Feb-06, at 7:05 PM, Dylan Stamat wrote: > > > Hey John ! I just use the session[], and keep track of the > > pages... etc. > > I think that is about the best way to do it as far as I know. Just > > did this this morning :) > > > > > > On 2/14/06, John Kopanas <john@protoseinc.com> wrote: Are there any > > best practices for implementing a back/cancel/return > > button... even when the page you want to return people too is 2 > pages > > back (when people submit form and then want to return)? > > > > Thanks :-) > > > > Your Friend, > > > > John Kopanas > > http://www.kopanas.com > > > > > > > ====================================================================> > http://www.soen.info - source of the freshest software engineering > > information on the net > > http://cusec.soen.info - software engineering conference > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > John Kopanas > http://www.kopanas.com > > > ====================================================================> http://www.soen.info - source of the freshest software engineering > information on the net > http://cusec.soen.info - software engineering conference > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/railsJohn Kopanas http://www.kopanas.com ====================================================================http://www.soen.info - source of the freshest software engineering information on the net http://cusec.soen.info - software engineering conference
I think you two were misunderstanding each other... Dylan was talking about controlling which page in a sequence of pages a user can go to (a "wizard"), whereas John just wants to create a back-button link. N''est pas? b PS: John, why not just make the "back" link go the url it should? You solution won''t work if javascript''s not enabled (though we''re basically turning into a javascript or nothing world). John Kopanas wrote:> Wow... that is crazy :-). > > For now I am going with: > <%= link_to "return without loging-in", "javascript:history.back()" %> > > Unless someone has better suggestions :-). > > On 14-Feb-06, at 7:34 PM, Dylan Stamat wrote: > >> none. when im on the first page of the form, i set something new in >> the session, like: session[:user_reg_first], with an arbitrary >> value. when they get to the second page, i do the same but with >> session[:user_reg_second]...etc...etc. >> if someone is on the first page, and tries to go to the third, i make >> sure they have a valid entry in session[:user_reg_third], if they >> don''t, I check session[:user_reg_second]...etc >> >> i think you get the idea. it''s a verbose method... but it works for >> me :) >> >> >> >> On 2/14/06, John Kopanas <john@protoseinc.com> wrote: What variable >> do you use to get the page? >> >> On 14-Feb-06, at 7:05 PM, Dylan Stamat wrote: >> >> > Hey John ! I just use the session[], and keep track of the >> > pages... etc. >> > I think that is about the best way to do it as far as I know. Just >> > did this this morning :) >> > >> > >> > On 2/14/06, John Kopanas <john@protoseinc.com> wrote: Are there any >> > best practices for implementing a back/cancel/return >> > button... even when the page you want to return people too is 2 pages >> > back (when people submit form and then want to return)? >> > >> > Thanks :-) >> > >> > Your Friend, >> > >> > John Kopanas >> > http://www.kopanas.com >> > >> > >> > ====================================================================>> > http://www.soen.info - source of the freshest software engineering >> > information on the net >> > http://cusec.soen.info - software engineering conference >> > >> > >> > _______________________________________________ >> > Rails mailing list >> > Rails@lists.rubyonrails.org >> > http://lists.rubyonrails.org/mailman/listinfo/rails >> > >> > _______________________________________________ >> > Rails mailing list >> > Rails@lists.rubyonrails.org >> > http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> John Kopanas >> http://www.kopanas.com >> >> >> ====================================================================>> http://www.soen.info - source of the freshest software engineering >> information on the net >> http://cusec.soen.info - software engineering conference >> >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails > > > > John Kopanas > http://www.kopanas.com > > > ====================================================================> http://www.soen.info - source of the freshest software engineering > information on the net > http://cusec.soen.info - software engineering conference > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
On 14-Feb-06, at 7:41 PM, John Kopanas wrote:> For now I am going with: > <%= link_to "return without loging-in", "javascript:history.back()" %> > > Unless someone has better suggestions :-).you can also try: <%= link_to ''back'', request.env[''HTTP_REFERER''] %> /Jeff -- http://quotedprintable.com
Ahh... true. Well put Ben, thanks :) John, my explanation was indeed for a wizardy/multi-step form process. On 2/14/06, Jeffrey Hardy <packagethief@gmail.com> wrote:> > On 14-Feb-06, at 7:41 PM, John Kopanas wrote: > > For now I am going with: > > <%= link_to "return without loging-in", "javascript:history.back()" %> > > > > Unless someone has better suggestions :-). > > you can also try: > <%= link_to ''back'', request.env[''HTTP_REFERER''] %> > > /Jeff > > -- > http://quotedprintable.com > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060215/bf965d40/attachment.html
Hello, On Tue, Feb 14, 2006 at 06:49:37PM -0500, John Kopanas wrote:> Are there any best practices for implementing a back/cancel/return > button... even when the page you want to return people too is 2 pages > back (when people submit form and then want to return)?I use this code when I know I will have to redirect a user back: def store_location session[:return_to] = request.request_uri end def redirect_back redirect_to(session[:return_to]) end You could use session[:return_to] to create a back link. Hope this helps! See you -- Damien MERENNE <dam@cosinux.org> http://www.cosinux.org/blogs/dam/ Chuck Norris doesnt shave; he kicks himself in the face. The only thing that can cut Chuck Norris is Chuck Norris.