Automatic save


#1

I have a page where people might be writing information for a long time.
So I want a feature like autosave.
I have used PeriodicalExecuter and Ajax.Request to submit the form
regularly. That part is working fine.
I also made a link_to_remote that calls a show method and updates with
information from the database. The show method uses respond_to to see
if
it should return javascript or html. That part is working fine.

The problem is that I want the save command to be automatically followed
by the show to update the information. So in the save method I redirect
to the show method. The show method gets called after the save, but
apparently the X-Requested-With header is not set in this redirected
request so the show method returns html with the result that no update
happens in the client. If I then press the update link_to_remote the
update happens correctly.

Is that an error to do a redirect this way or is there a problem with
the
X-Requested-With header?