diff options
author | Claudio B <claudiob@users.noreply.github.com> | 2016-07-18 18:09:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-18 18:09:59 -0700 |
commit | c02f3ea5e31677e7953abee5a1a2d5398d85ad47 (patch) | |
tree | 5ded6f24d4cb94de32863a2770e4b200e026d42c | |
parent | 5a302bf553af0e6fedfc63299fc5cd6e79599ef3 (diff) | |
parent | 9ab63547e5ca52dc4d50d885c3b2da751b9381fc (diff) | |
download | rails-c02f3ea5e31677e7953abee5a1a2d5398d85ad47.tar.gz rails-c02f3ea5e31677e7953abee5a1a2d5398d85ad47.tar.bz2 rails-c02f3ea5e31677e7953abee5a1a2d5398d85ad47.zip |
Merge pull request #25883 from claudiob/fix-gotcha
Fix docs in collection_radio_buttons
-rw-r--r-- | actionview/lib/action_view/helpers/form_options_helper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionview/lib/action_view/helpers/form_options_helper.rb b/actionview/lib/action_view/helpers/form_options_helper.rb index 06b696f281..0cd3207b12 100644 --- a/actionview/lib/action_view/helpers/form_options_helper.rb +++ b/actionview/lib/action_view/helpers/form_options_helper.rb @@ -651,12 +651,12 @@ module ActionView # The HTML specification says when nothing is select on a collection of radio buttons # web browsers do not send any value to server. # Unfortunately this introduces a gotcha: - # if a +User+ model has a +category_id+ field, and in the form none category is selected no +category_id+ parameter is sent. So, - # any strong parameters idiom like + # if a +User+ model has a +category_id+ field and in the form no category is selected, no +category_id+ parameter is sent. So, + # any strong parameters idiom like: # # params.require(:user).permit(...) # - # will raise an error since no +{user: ...}+ will be present. + # will raise an error since no <tt>{user: ...}</tt> will be present. # # To prevent this the helper generates an auxiliary hidden field before # every collection of radio buttons. The hidden field has the same name as collection radio button and blank value. |