提交 03472800 编写于 作者: C Carlos Antonio da Silva

Simplify setting button form options

No need to merge hashes when simply setting options does the job.
上级 a3f03068
......@@ -292,8 +292,9 @@ def button_to(name = nil, options = nil, html_options = nil, &block)
form_method = method == 'get' ? 'get' : 'post'
form_options = html_options.delete('form') || {}
form_options[:class] ||= html_options.delete('form_class') || 'button_to'
form_options.merge!(method: form_method, action: url)
form_options.merge!("data-remote" => "true") if remote
form_options[:method] = form_method
form_options[:action] = url
form_options[:'data-remote'] = true if remote
request_token_tag = form_method == 'post' ? token_tag : ''
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册