1
0
Fork 0
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:
Carlos Antonio da Silva 2015-03-22 20:27:00 -03:00
parent a3f030686b
commit 0347280035

View file

@ -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 : ''