Fernando Perez
2009-Feb-23 20:56 UTC
Refreshing browser after form submit and redirect bug
Hi, Let''s say I have a form I submit restfully to the update action of a controller. On successful update, the application redirects to the index action. Now in some of my forms if I hit the refresh button on my index page, the browser wants to resubmit the form! How is that possible? I can see in my log file that I got a 302. Thanks 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 -~----------~----~----~----~------~----~------~--~---
Fernando Perez
2009-Mar-02 22:07 UTC
Re: Refreshing browser after form submit and redirect bug
> Let''s say I have a form I submit restfully to the update action of a > controller. On successful update, the application redirects to the index > action. > > Now in some of my forms if I hit the refresh button on my index page, > the browser wants to resubmit the form! How is that possible? I can see > in my log file that I got a 302.So I''m the only guy who has this problem? -- 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 -~----------~----~----~----~------~----~------~--~---
Fernando Perez
2009-Mar-21 23:04 UTC
Re: Refreshing browser after form submit and redirect bug
> Let''s say I have a form I submit restfully to the update action of a > controller. On successful update, the application redirects to the index > action. > > Now in some of my forms if I hit the refresh button on my index page, > the browser wants to resubmit the form! How is that possible? I can see > in my log file that I got a 302.I finally got it fixed! I wasn''t redirecting to the correct named_route, but to resources_url instead, so Rails thought that I wanted to still keep the POST data. -- 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 -~----------~----~----~----~------~----~------~--~---