From cbe70e27f26cf3fb93c71e2ef61dd39faf9e31b0 Mon Sep 17 00:00:00 2001 From: lauren spath luhring Date: Tue, 22 Dec 2015 13:07:34 -0700 Subject: [PATCH] Update README.md clearly define `:selected` as an option to pass for collections. it took me a long time to figure out that this is what i needed! --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3742e22c..c0e77d11 100644 --- a/README.md +++ b/README.md @@ -331,6 +331,8 @@ 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). +You may also find it useful to explicitly pass a value to the optional `:selected`, especially if passing a collection of nested objects. + It is also possible to create grouped collection selects, that will use the html *optgroup* tags, like this: ```ruby