aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers
diff options
context:
space:
mode:
authorVasiliy Ermolovich <younash@gmail.com>2013-09-22 16:37:12 +0300
committerVasiliy Ermolovich <younash@gmail.com>2013-09-22 21:49:01 +0300
commit0b0ac5d917ccfe3e48bc75456dbccf48de7f33d0 (patch)
tree7fe3d2679b7febaa67517a55aead14b964cff0ae /actionview/lib/action_view/helpers
parent80008352675add5a6b4aaded715fc02329a02004 (diff)
downloadrails-0b0ac5d917ccfe3e48bc75456dbccf48de7f33d0.tar.gz
rails-0b0ac5d917ccfe3e48bc75456dbccf48de7f33d0.tar.bz2
rails-0b0ac5d917ccfe3e48bc75456dbccf48de7f33d0.zip
handle `:namespace` form option in collection labels
Diffstat (limited to 'actionview/lib/action_view/helpers')
-rw-r--r--actionview/lib/action_view/helpers/tags/collection_helpers.rb3
-rw-r--r--actionview/lib/action_view/helpers/tags/label.rb1
2 files changed, 3 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/tags/collection_helpers.rb b/actionview/lib/action_view/helpers/tags/collection_helpers.rb
index 388dcf1f13..787039c82e 100644
--- a/actionview/lib/action_view/helpers/tags/collection_helpers.rb
+++ b/actionview/lib/action_view/helpers/tags/collection_helpers.rb
@@ -18,7 +18,8 @@ module ActionView
end
def label(label_html_options={}, &block)
- @template_object.label(@object_name, @sanitized_attribute_name, @text, label_html_options, &block)
+ html_options = label_html_options.merge(@input_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 35d3ba8434..180aa9ac27 100644
--- a/actionview/lib/action_view/helpers/tags/label.rb
+++ b/actionview/lib/action_view/helpers/tags/label.rb
@@ -30,6 +30,7 @@ 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?