Hi,
When using partials, I''m not able to keep the text posted as
ISO-8859-1, it changes to UTF-8.
The browser detects the page as ISO-8859-1, but I know the string from
the form is not
ISO-8859-1 when given to the method.
I''m able to keep the string as ISO-8859-1 if I don''t use any
partials or RJS.
This is how the view with partials and RJS looks like:
main.rhtml
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type"
content="text/html;charset=ISO-8859-1" />
<title>Send it: <%= controller.action_name %></title>
<%= stylesheet_link_tag ''nb'' %>
</head>
<body>
<%= render :partial => "publish" %>
_publish.rhtml
<head>
<meta http-equiv="Content-type" content="text/html;
charset=ISO-8859-1" />
</head>
<body>
<%= form_remote_tag :url => { :action =>
''publish'' },
:before => "Element.show(''spinner'');",
:success => "show_results(xhr);",
:failure => "show_error(xhr);",
:complete => "Element.hide(''spinner'');",
:html => { :id => ''thought-form'' } %>
<br>Message:<br>
<%= text_area ''message'', ''text'',
:maxlength => 60 %>
<%= submit_tag ''Publish'' %>
<%= end_form_tag %>
<div id="thoughts">
</div>
publish.rjs:
page.replace_html ''thoughts'', :partial =>
''status''
page.visual_effect :highlight, ''thoughts''
page.form.reset ''thought-form''
_status.rhtml
<p>
<p style="color: green"><%= flash[:notice]
%></p>
<p style="color: red"><%= flash[:warning]
%></p>
</p>
The code abow changes the input string to UTF-8, but the below does not.
How do I make sure the string is ISO-8859-1 through all of the application?
plain_publish.rhtml
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html;
charset=ISO-8859-1" />
</head>
<body>
<%= form_tag :action => ''plainpublish'' %>
<br>Message:<br>
<%= text_area ''message'', ''text'',
:maxlength => 60 %>
<%= submit_tag ''Publish'' %>
<%= end_form_tag %>
The methods are identical except for the name.
Any thoughts or suggestions are highly appreciated! :)
--
Regards,
Martin Stabenfeldt
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---