diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-06-11 16:21:32 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-06-11 16:30:26 +0900 |
commit | bc9051422844c706b18fddc1449ea5e311c83490 (patch) | |
tree | 6e95f1e3063b7fc7f0f446ac5d7758c9f7075aef /actionview/lib | |
parent | ddea3164250ed5f3886f07cbbc01727fd6dff99c (diff) | |
download | rails-bc9051422844c706b18fddc1449ea5e311c83490.tar.gz rails-bc9051422844c706b18fddc1449ea5e311c83490.tar.bz2 rails-bc9051422844c706b18fddc1449ea5e311c83490.zip |
Generate field ids in `collection_check_boxes` and `collection_radio_buttons`
This makes sure that the labels are linked up with the fields.
Fixes #29014
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/helpers/tags/collection_check_boxes.rb | 1 | ||||
-rw-r--r-- | actionview/lib/action_view/helpers/tags/collection_radio_buttons.rb | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/actionview/lib/action_view/helpers/tags/collection_check_boxes.rb b/actionview/lib/action_view/helpers/tags/collection_check_boxes.rb index 7252d4f2d9..e02b7bdb2e 100644 --- a/actionview/lib/action_view/helpers/tags/collection_check_boxes.rb +++ b/actionview/lib/action_view/helpers/tags/collection_check_boxes.rb @@ -10,6 +10,7 @@ module ActionView def check_box(extra_html_options = {}) html_options = extra_html_options.merge(@input_html_options) html_options[:multiple] = true + html_options[:skip_default_ids] = false @template_object.check_box(@object_name, @method_name, html_options, @value, nil) end end diff --git a/actionview/lib/action_view/helpers/tags/collection_radio_buttons.rb b/actionview/lib/action_view/helpers/tags/collection_radio_buttons.rb index a5f72af9ff..f085a5fb73 100644 --- a/actionview/lib/action_view/helpers/tags/collection_radio_buttons.rb +++ b/actionview/lib/action_view/helpers/tags/collection_radio_buttons.rb @@ -9,6 +9,7 @@ module ActionView class RadioButtonBuilder < Builder # :nodoc: def radio_button(extra_html_options = {}) html_options = extra_html_options.merge(@input_html_options) + html_options[:skip_default_ids] = false @template_object.radio_button(@object_name, @method_name, @value, html_options) end end |