Skip to content

Commit

Permalink
fix button tag without options
Browse files Browse the repository at this point in the history
  • Loading branch information
prikha committed Mar 3, 2014
1 parent aa2101e commit 4a7c8ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions actionview/lib/action_view/helpers/form_tag_helper.rb
Expand Up @@ -469,7 +469,7 @@ 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? && content_or_options.is_a?(Hash)
if block_given?
options = button_tag_options_with_defaults(content_or_options)
content_tag :button, options, &block
else
Expand Down Expand Up @@ -744,7 +744,7 @@ def sanitize_to_id(name)

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
Expand Down

0 comments on commit 4a7c8ef

Please sign in to comment.