# Refreshing browser after form submit and redirect bug

**URL:** <https://www.ruby-forum.com/t/refreshing-browser-after-form-submit-and-redirect-bug/161151>\
**Category:** Rails\
**Created:** [February 23, 2009, 9:56pm UTC](https://www.ruby-forum.com/t/refreshing-browser-after-form-submit-and-redirect-bug/161151 "2009-02-23T21:56:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [February 23, 2009, 9:56pm UTC](https://www.ruby-forum.com/t/refreshing-browser-after-form-submit-and-redirect-bug/161151/1 "2009-02-23T21:56:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [March 2, 2009, 11:07pm UTC](https://www.ruby-forum.com/t/refreshing-browser-after-form-submit-and-redirect-bug/161151/2 "2009-03-02T23:07:31Z")

</div>

> 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?

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [March 22, 2009, 12:04am UTC](https://www.ruby-forum.com/t/refreshing-browser-after-form-submit-and-redirect-bug/161151/3 "2009-03-22T00:04:28Z")

</div>

> 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.
