When using the base FormTagHelper#form_tag, it's pretty simple.
<% form_tag(search_solutions_path, {:'accept-charset' => "UTF-8"}) do -%>
...
<% end -%>
Note the use of the quotes around the symbol
accept-charset. This is required because a hyphen requires escaping to be used in Ruby symbols.When using the RESTful FormHelper#form_for, it's a bit more complicated and not very clearly documented. After some debugging and trial & error, I figured out that you have to add another level of indirection to add HTML options.
<% form_for(@model, {:html => {:'accept-charset' => "UTF-8"}}) do |f| %>
...
<% end -%>
0 comments:
Post a Comment