From ed4fc43287562efab01a903507cd0b9d19388a74 Mon Sep 17 00:00:00 2001 From: Sergey Prikhodko Date: Mon, 3 Mar 2014 17:16:28 +0400 Subject: fix content_or_options to be replaced by options and set to nil --- actionview/lib/action_view/helpers/form_tag_helper.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'actionview/lib/action_view/helpers/form_tag_helper.rb') diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index 5136e4dda4..4113acc6e9 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -469,7 +469,12 @@ module ActionView # # => # def button_tag(content_or_options = nil, options = nil, &block) - options = content_or_options.is_a?(Hash) ? content_or_options : options + + if content_or_options.is_a?(Hash) + options = content_or_options + content_or_options = nil + end + options = button_tag_options_with_defaults(options) content_tag :button, content_or_options || 'Button', options, &block end -- cgit v1.2.3