diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-08-25 07:39:31 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-08-25 07:39:31 -0700 |
commit | 67274ca162cf198bc8eabd619c81e3fc6156a229 (patch) | |
tree | 3eee900757d01073bc320b5ed3023283a5c74607 /actionpack/lib/action_view | |
parent | d15069316f331c46165248c2df869145fef60008 (diff) | |
parent | 895d64531d25a76c1de2d4fec9aba68c0ee8c104 (diff) | |
download | rails-67274ca162cf198bc8eabd619c81e3fc6156a229.tar.gz rails-67274ca162cf198bc8eabd619c81e3fc6156a229.tar.bz2 rails-67274ca162cf198bc8eabd619c81e3fc6156a229.zip |
Merge pull request #2491 from waynn/fix_symbol
fix destructive stringify_keys for label_tag
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_tag_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index 9ed4611123..ac2a6982fb 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -179,9 +179,9 @@ module ActionView def label_tag(name = nil, content_or_options = nil, options = nil, &block) options = content_or_options if block_given? && content_or_options.is_a?(Hash) options ||= {} - options.stringify_keys! + options = options.stringify_keys options["for"] = sanitize_to_id(name) unless name.blank? || options.has_key?("for") - content_tag :label, content_or_options || name.to_s.humanize, options, &block + content_tag :label, content_or_options.is_a?(Hash) ? options : (content_or_options || name.to_s.humanize), options, &block end # Creates a hidden form input field used to transmit data that would be lost due to HTTP's statelessness or |