diff options
author | Vasiliy Ermolovich <younash@gmail.com> | 2015-06-08 23:55:10 +0300 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-20 16:39:05 -0600 |
commit | c2ad51a2d037b709f4475cf115d89432ec56caac (patch) | |
tree | de9f93686100c37d4a9f5dd57cc195a177edf203 /actionview/lib | |
parent | 7e434d6d2d3e8056e3024f6a3ec2db9e0365d10a (diff) | |
download | rails-c2ad51a2d037b709f4475cf115d89432ec56caac.tar.gz rails-c2ad51a2d037b709f4475cf115d89432ec56caac.tar.bz2 rails-c2ad51a2d037b709f4475cf115d89432ec56caac.zip |
Collection check boxes propagates input's id to the label's for attribute.
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/helpers/tags/collection_helpers.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/actionview/lib/action_view/helpers/tags/collection_helpers.rb b/actionview/lib/action_view/helpers/tags/collection_helpers.rb index fea4c8d4ec..b87b4281d6 100644 --- a/actionview/lib/action_view/helpers/tags/collection_helpers.rb +++ b/actionview/lib/action_view/helpers/tags/collection_helpers.rb @@ -19,6 +19,8 @@ module ActionView def label(label_html_options={}, &block) html_options = @input_html_options.slice(:index, :namespace).merge(label_html_options) + html_options[:for] ||= @input_html_options[:id] if @input_html_options[:id] + @template_object.label(@object_name, @sanitized_attribute_name, @text, html_options, &block) end end |