Possibly a simple one - I have a form and an action and then
afterwards a redirect_to. When the user submits the form, the data is
stored and then the user is redirected to another page. If the user
then refreshes the page they have been redirected to, they are then
prompted to resubmit the form. Can anyone suggest why this is
occurring and how to stop it occurring!
Thanks,
Alastair
Alastair M.
Standards compliant web development with Ruby On Rails, PHP and ASP www.kozmo.co.uk
07738 399038
If I was to submit a form on a site and then click back, the browser
(certainly firefox and camino on the Mac) will often prompt you to
submit the form. It’s doing that. It doesn’t show the form again,
simply on refreshing it’s as it the page I’ve been passed to was the
page that the original form was submitted to rather than redirected to
after the form has been processed. This means, for example, a user-sign
up form, the user enters their data and then is redirected to a new
page after the form has been submitted. If the user then refreshes the
page, they are prompted to save their form data again and a new record
is stored (or attempted to be stored) in the DB . I will try and put an
example up if I’m not being clear
If I was to submit a form on a site and then
click back, the browser (certainly firefox and
camino on the Mac) will often prompt you to
submit the form.
The behavior that comes to mind from your description is where a dialog
pops
up saying something like “the page contains POST data and will be
resubmitted if you continue.” Is that what you’re talking about?
If the user then refreshes the page, a new record
is stored (or attempted to be stored) in the DB .
Are you sure about the new record being created?
I will try and put an
example up if I’m not being clear
That’ll probably help
Best regards,
Bill
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.