aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/lib/action_view/helpers')
-rw-r--r--actionview/lib/action_view/helpers/form_tag_helper.rb7
1 files changed, 6 insertions, 1 deletions
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
# # => <button data-disable-with="Please wait..." name="button" type="submit">Checkout</button>
#
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