提交 4a7c8ef7 编写于 作者: S Sergey Prikhodko

fix button tag without options

上级 aa2101ed
......@@ -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
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册