Periodically autosave form


#1

Would someone show how to implement a periodical save of a form in the
background? Same kinda thing that gmail does. I would like to
autosave a form ajax wise so a technician in the field would have it
saved off in case of a wireless disconnect while filling out a form.
thanks.

I would guess on doing the periodically call remote but how do you
submit the form?


#2

A caveat, It has to be done with the form already having been
created. So doing an observe form with a form id will not work as the
form id id being generated by rails as it is in edit mode.


#3

I am not sure about your situation, but I would use observe_form set
and :frequency to seconds at which changes to this field will be
detected. This should work with the existing form.

See the documentation.
http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html


#4

In this case, he does not even have to observe the form.

He can just call a script on page load which shoots off an Ajax submit
and update on the form every minute or so.