From 51ff88cf6ae72c8c09145b0c0cba1e154d3068f1 Mon Sep 17 00:00:00 2001 From: Sergey Prikhodko Date: Mon, 3 Mar 2014 16:33:24 +0400 Subject: fix form button --- actionview/lib/action_view/helpers/form_tag_helper.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'actionview') diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index ccb5c036dc..9f2eb49f72 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -469,12 +469,9 @@ module ActionView # # => # def button_tag(content_or_options = nil, options = nil, &block) - if block_given? - options = button_tag_options_with_defaults(content_or_options) - content_tag :button, options, &block - else + options = content_or_options.is_a?(Hash) ? content_or_options : options options = button_tag_options_with_defaults(options) - content_tag :button, content_or_options || 'Button', options + content_tag :button, content_or_options || 'Button', options, &block end end -- cgit v1.2.3