FormProtector will remind users, via JavaScript, to submit their forms before navigating away from a page.
Include the FormProtector JavaScript by adding javascript_include_form_protector
to your layout. Then use protect_form
in your view to protect the form.
A plain form with the id of ‘my_form_id’.
<%= protect_form('my_form_id') %>
A form_for form:
<%= protect_form(dom_id(@record, :edit)) %>
Copyright © 2009 Eric Davis, Little Stream Software, released under the MIT license