diff options
author | Andriel Nuernberg <andriel.nuernberg@plataformatec.com.br> | 2013-12-01 04:50:21 -0200 |
---|---|---|
committer | Andriel Nuernberg <andriel.nuernberg@plataformatec.com.br> | 2013-12-05 20:27:38 -0200 |
commit | ec19c77ca570919a78efcf2a801863e0eefe98c3 (patch) | |
tree | 2417a41c2bd7d0bf0c38a53701e49d2cb1d1d6e8 /actionview/lib | |
parent | b372690b786c639d17a5e4c1d40459fbed89f878 (diff) | |
download | rails-ec19c77ca570919a78efcf2a801863e0eefe98c3.tar.gz rails-ec19c77ca570919a78efcf2a801863e0eefe98c3.tar.bz2 rails-ec19c77ca570919a78efcf2a801863e0eefe98c3.zip |
Label only accepts `:index` and `:namespace` attributes from the input
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/helpers/tags/collection_helpers.rb | 2 | ||||
-rw-r--r-- | actionview/lib/action_view/helpers/tags/label.rb | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/actionview/lib/action_view/helpers/tags/collection_helpers.rb b/actionview/lib/action_view/helpers/tags/collection_helpers.rb index 787039c82e..991f32cea2 100644 --- a/actionview/lib/action_view/helpers/tags/collection_helpers.rb +++ b/actionview/lib/action_view/helpers/tags/collection_helpers.rb @@ -18,7 +18,7 @@ module ActionView end def label(label_html_options={}, &block) - html_options = label_html_options.merge(@input_html_options) + html_options = @input_html_options.slice(:index, :namespace).merge(label_html_options) @template_object.label(@object_name, @sanitized_attribute_name, @text, html_options, &block) end end diff --git a/actionview/lib/action_view/helpers/tags/label.rb b/actionview/lib/action_view/helpers/tags/label.rb index 180aa9ac27..35d3ba8434 100644 --- a/actionview/lib/action_view/helpers/tags/label.rb +++ b/actionview/lib/action_view/helpers/tags/label.rb @@ -30,7 +30,6 @@ module ActionView add_default_name_and_id_for_value(tag_value, name_and_id) options.delete("index") options.delete("namespace") - options.delete("multiple") options["for"] = name_and_id["id"] unless options.key?("for") if block_given? |