aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-06-11 16:21:32 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-06-11 16:30:26 +0900
commitbc9051422844c706b18fddc1449ea5e311c83490 (patch)
tree6e95f1e3063b7fc7f0f446ac5d7758c9f7075aef /actionview/lib
parentddea3164250ed5f3886f07cbbc01727fd6dff99c (diff)
downloadrails-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.rb1
-rw-r--r--actionview/lib/action_view/helpers/tags/collection_radio_buttons.rb1
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