Rails bug with partials and charsets?

Hi,

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 http://pastie.caboo.se/73275

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!

Cheers,
Martin Stabenfeldt

Well, for starters, you've got <head> and <body> 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 <heads> wasn't the
problem, which it might be.)

Hi,

On Jun 25, 8:01 am, "Martin Stabenfeldt" <mar...@stabenfeldt.net>
> 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 <head> and <body> 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 <heads> 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.

  iso_str = Iconv.new('iso-8859-1', 'utf-8').iconv(message)
  encoded_message = CGI.escape(iso_str)

Cheers,
Martin