Forum: Ruby on Rails Refreshing browser after form submit and redirect bug

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fernando P. (Guest)
on 2009-02-23 22:56
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
Fernando P. (Guest)
on 2009-03-03 00:07
> 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?
Fernando P. (Guest)
on 2009-03-22 01:04
> 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.
This topic is locked and can not be replied to.