Is there a bug with the use of partials and how the input from forms is
handled?
My app is working fine if I use a plain view and form_tag, but as
soon as I switch to partials and form_remote_tag I’m not able to
keep the input as ISO-8859-1
I’d like to use form_remote_tag, or at least find a way to keep the
spinner and Ajax effects.
The code is available at Parked at Loopia
I’m running Ruby 1.8.5 and Rails 1.2.3.
Any hints to what I might do wrong, or what topics I should dig into, is
highly appreciated!
Well, for starters, you’ve got and tags in your
partial. That’s got to be confusing your browser. Rip the first 4
lines out of your partial and try again.
My next suggestion is to try to move your _publish partial into
main.rhtml. I suspect the problem you’re having has nothing to do
with using partials, and more to do with how rails, or your browser,
processes AJAX requests. (Assuming that the two wasn’t the
problem, which it might be.)
Is there a bug with the use of partials and how the input from forms is
handled?
My app is working fine if I use a plain view and form_tag, but as
soon as I switch to partials and form_remote_tag I’m not able to
keep the input as ISO-8859-1
Well, for starters, you’ve got and tags in your
partial. That’s got to be confusing your browser. Rip the first 4
lines out of your partial and try again.
My next suggestion is to try to move your _publish partial into
main.rhtml. I suspect the problem you’re having has nothing to do
with using partials, and more to do with how rails, or your browser,
processes AJAX requests. (Assuming that the two wasn’t the
problem, which it might be.)
Thanks for the tips Jon, I tried that but wasn´t able to keep the
charset even after I made the changes you suggested.
The only part that really needed ISO-8859-1 was CGI.escape, so I
converted the string with iconv just before I passed it along to
CGI.escape.