Detect in rails if user refreshes the page

I am using rails 3.0 and ruby ​​1.8.7

How to determine if a user is refreshing a browser page?

I am coding a webmaster form so I proceed to the next step if everything is correct. However, if the user refreshes the page, I don't want to go to the next step.

Refresh

I put a hidden field (I know about the session solution) that gets updated when the user submits the form. My problem is that the form has many steps.

Any idea? Sorry Thank you in advance

+3


source to share


2 answers


The server doesn't really need to know anything about the state of the client, which is why REST was created.



+2


source


If you really need it, you can use the flash object to detect when the user refreshes the page.



For this you need the page entry point to be redirect_to, so this complicates things a bit, but at least it will solve your problem.

0


source







All Articles