Is it possible to specify html attributes while using the form_for helper methods?
For example:
<% form_for @user do |f| %>
<%= f.labe开发者_如何学Cl :username%>
<%= f.text_field :username %>
<%= f.submit "Signn Up" %>
<% end %>
How would I go about specifying the class for the label? Is it possible, or do I have to resort to label()?
On mostly helpers, the last arg is a hash of html options for the element.
<%= f.label :username, "Username", :class => "class" %>
精彩评论