Permalink
Browse files

Added :wrapper_html example to the README.

  • Loading branch information...
1 parent d1f34e0 commit 8ee50d81e35826f856bb60b9255a0d640cec863d @olivierlacan olivierlacan committed Sep 28, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 README.md
View
@@ -97,6 +97,17 @@ It is also possible to pass any html attribute straight to the input, by using t
<% end %>
```
+Since simple_form generates a wrapper div around your label and input by default, you can pass any html attribute to that wrapper as well using the :wrapper_html option, like so:
+
+```erb
+ <%= simple_form_for @user do |f| %>
+ <%= f.input :username, :wrapper_html => { :class => 'username' } %>
+ <%= f.input :password, :wrapper_html => { :id => 'password' } %>
+ <%= f.input :remember_me, :wrapper_html => { :class => 'options' } %>
+ <%= f.button :submit %>
+ <% end %>
+```
+
By default all inputs are required, which means an * is prepended to the label, but you can disable it in any input you want:
```erb

0 comments on commit 8ee50d8

Please sign in to comment.