It is common practice to implement semi-persistent state across page
views using hidden form fields since all major browsers repopulate the
form fields with the last value of each field (provided that the
browser hasn’t been closed). A longer explanation with samples is
here:
http://codinginparadise.org/weblog/2005/08/ajax-tutorial-saving-session-across.html
There’s a very simple example at the bottom of that page that I’ve
been able to recreate perfectly… until I try to get it to work in
Rails under Internet Explorer. A working example is available here:
http://www1.zvents.com/test.rhtml
View the page source and hit reload a couple times to see the purpose
of the page. It takes advantage of browsers repopulating form fields
to achieve semi-persistent storage.
If I take that EXACT same source and move it into a rails view
rendered without layout, we get the following:
http://www1.zvents.com/events/test
If you do a page source on each page, you’ll see that the source is
identical. But for some reason, the persistence does not work in IE!
Works fine in Firefox. I’ve tried this on Apache, lighttpd and
webrick using both an existing and a fresh rails code base and nothing
works. I’m completely out of ideas. Is there something about the way
that Rails handles requests (routes? rewriting?) that is messing up
IE’s ability to repopulate form values?
I’ve also noticed that this affects all my regular HTML forms as well
(again IE only).
Any thoughts or help would be appreciated.
Tyler