mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Simplify setting button form options
No need to merge hashes when simply setting options does the job.
This commit is contained in:
parent
a3f030686b
commit
0347280035
1 changed files with 3 additions and 2 deletions
|
@ -292,8 +292,9 @@ module ActionView
|
|||
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 : ''
|
||||
|
||||
|
|
Loading…
Reference in a new issue