Merge pull request #743 from marcamillion/patch-1

Updated ReadMe to include instructions on how to strip away all wrapper divs.
This commit is contained in:
Lucas Mazza 2013-02-12 15:04:55 -08:00
commit cdfc1a9800
1 changed files with 22 additions and 0 deletions

View File

@ -221,6 +221,28 @@ the wrapper as well:
Any extra option passed to these methods will be rendered as html option.
### Stripping away all wrapper divs
**SimpleForm** also allows you to strip away all the div wrappers around the `<input>` field that is generated with the usual `f.input`.
The easiest way to achieve this is to use `f.input_field`.
Example:
```erb
simple_form_for @user do |f|
f.input_field :name
end
```
Produces:
```erb
<input class="string required" id="user_name" maxlength="100"
name="user[name]" size="100" type="text" value="Carlos" />
```
To view the actual RDocs for this, check them out here - http://rubydoc.info/github/plataformatec/simple_form/master/SimpleForm/FormBuilder:input_field
### Collections
And what if you want to create a select containing the age from 18 to 60 in your form? You can do it