~ Add doc for option `selected` to README

[ci skip]
This commit is contained in:
PikachuEXE 2015-05-07 10:08:04 +08:00
parent 7cb9d0252a
commit 2a7cb93a0e
1 changed files with 2 additions and 1 deletions

View File

@ -327,8 +327,9 @@ translation. All other options given are sent straight to the underlying helper.
can give prompt as:
```ruby
f.input :age, collection: 18..60, prompt: "Select your age"
f.input :age, collection: 18..60, prompt: "Select your age", selected: 21
```
Extra options are passed into helper [`collection_select`](http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#method-i-collection_select).
It is also possible to create grouped collection selects, that will use the html *optgroup* tags, like this: