fix content_or_options to be replaced by options and set to nil

This commit is contained in:
Sergey Prikhodko 2014-03-03 17:16:28 +04:00
parent 28c0177524
commit ed4fc43287

@ -469,7 +469,12 @@ 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)
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