diff options
author | Xavier Noria <fxn@hashref.com> | 2013-08-07 06:09:50 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2013-08-07 06:10:18 +0200 |
commit | 4a7fba09f4893457c17cab6f5cdd86aeb20120a1 (patch) | |
tree | a21c8f6c5fde3cc4a4bfcf090acccc531bc62379 /actionview | |
parent | 174f21933964d6988095600f57f023e1910808c5 (diff) | |
download | rails-4a7fba09f4893457c17cab6f5cdd86aeb20120a1.tar.gz rails-4a7fba09f4893457c17cab6f5cdd86aeb20120a1.tar.bz2 rails-4a7fba09f4893457c17cab6f5cdd86aeb20120a1.zip |
RDoc tweaks
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/lib/action_view/helpers/form_options_helper.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/actionview/lib/action_view/helpers/form_options_helper.rb b/actionview/lib/action_view/helpers/form_options_helper.rb index e7f932ca06..fcd151ac32 100644 --- a/actionview/lib/action_view/helpers/form_options_helper.rb +++ b/actionview/lib/action_view/helpers/form_options_helper.rb @@ -97,14 +97,17 @@ module ActionView # Create a select tag and a series of contained option tags for the provided object and method. # The option currently held by the object will be selected, provided that the object is available. # - # There are two possible formats for the choices parameter, corresponding to other helpers' output: - # * A flat collection: see options_for_select - # * A nested collection: see grouped_options_for_select + # There are two possible formats for the +choices+ parameter, corresponding to other helpers' output: + # + # * A flat collection (see +options_for_select+). + # + # * A nested collection (see +grouped_options_for_select+). + # + # For example: # - # Example with @post.person_id => 1: # select("post", "person_id", Person.all.collect {|p| [ p.name, p.id ] }, { include_blank: true }) # - # could become: + # would become: # # <select name="post[person_id]"> # <option value=""></option> @@ -113,6 +116,8 @@ module ActionView # <option value="3">Tobias</option> # </select> # + # assuming the associated person has ID 1. + # # This can be used to provide a default set of options in the standard way: before rendering the create form, a # new model instance is assigned the default options and bound to @model_name. Usually this model is not saved # to the database. Instead, a second model object is created when the create request is received. |