Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix form button

  • Loading branch information...
commit 51ff88cf6ae72c8c09145b0c0cba1e154d3068f1 1 parent 4a7c8ef
@prikha prikha authored
Showing with 2 additions and 5 deletions.
  1. +2 −5 actionview/lib/action_view/helpers/form_tag_helper.rb
View
7 actionview/lib/action_view/helpers/form_tag_helper.rb
@@ -469,12 +469,9 @@ def submit_tag(value = "Save changes", options = {})
# # => <button data-disable-with="Please wait..." name="button" type="submit">Checkout</button>
#
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
Please sign in to comment.
Something went wrong with that request. Please try again.