From 4a7c8ef793dd5b13026efcc4a5a004bf96b0d1ea Mon Sep 17 00:00:00 2001 From: Sergey Prikhodko Date: Mon, 3 Mar 2014 15:40:16 +0400 Subject: fix button tag without options --- actionview/lib/action_view/helpers/form_tag_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index b3f681e6a7..ccb5c036dc 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -469,7 +469,7 @@ module ActionView # # => # def button_tag(content_or_options = nil, options = nil, &block) - if block_given? && content_or_options.is_a?(Hash) + if block_given? options = button_tag_options_with_defaults(content_or_options) content_tag :button, options, &block else @@ -744,7 +744,7 @@ module ActionView def button_tag_options_with_defaults(options) options = options || {} - options.stringify_keys! + options = options.stringify_keys default_options = { 'name' => 'button', 'type' => 'submit' } options.reverse_merge default_options -- cgit v1.2.3