Consider :
- - - -
<% form_for(@z) do |f| %> <%= f.error_messages %> <p> <%= f.label :x %><br /> <%= f.text_field :x, :class => 's' %> </p> <p> <%= f.submit 'Update' %> </p> <% end %>
- - - -
The above form works fine. What I want to do is have two classes, s and t, associated with text_field :x.
The following does not work.
- - - -
<% form_for(@z) do |f| %> <%= f.error_messages %> <p> <%= f.label :x %><br /> <%= f.text_field :x, :class => {'s', 't'} %> </p> <p> <%= f.submit 'Update' %> </p> <% end %>
- - - -
The code above will generate a single class class="st"
How can I have two classes in the same field using form helper? Do I have to generate my own html?