Jay
Jay

Reputation: 6244

Firefox form resubmit warning in a rails 2.3.8 app

in one section of our web site, a user will...

if they select a different item from the pull down menu before finishing the process, the following action in the controller directs them back to the first page for the new item.

def change_select_item
    flash[:error] = "You changed the selected item in the middle of this process. The item you left is not finished until you complete the process. To address the item you just selected requires us to start at the beginning."
    redirect_to :action => :index
end

when they are redirected back to the first page, i get this warning in Firefox.

To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier.

If someone clicks cancel, the redirect gets canceled leaving them on the same page only with the new selection which is exactly what i was trying to prevent.

Is there any way to clear the form data? Would that prevent the message from Firefox? Is there another way?

Thanks!

Upvotes: 2

Views: 251

Answers (1)

gorlok
gorlok

Reputation: 1155

I don't know RoR, but in many frameworks you need to use the pattern "Post/Redirect/Get".

Upvotes: 1

Related Questions