From 895d64531d25a76c1de2d4fec9aba68c0ee8c104 Mon Sep 17 00:00:00 2001 From: Waynn Lue Date: Thu, 11 Aug 2011 00:30:45 -0700 Subject: fix destructive stringify_keys for label_tag --- actionpack/lib/action_view/helpers/form_tag_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index 2bbe0c175f..92349508e6 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 -- cgit v1.2.3