Merge pull request #11508 from vipulnsward/extract_constants

Extract verbs array from helper to a contant
This commit is contained in:
Yves Senn 2013-07-20 01:46:10 -07:00
commit eda66d89c7
1 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ module ActionView
# provided here will only work in the context of a request # provided here will only work in the context of a request
# (link_to_unless_current, for instance), which must be provided # (link_to_unless_current, for instance), which must be provided
# as a method called #request on the context. # as a method called #request on the context.
BUTTON_TAG_METHOD_VERBS = %w{patch put delete}
extend ActiveSupport::Concern extend ActiveSupport::Concern
include TagHelper include TagHelper
@ -289,7 +289,7 @@ module ActionView
remote = html_options.delete('remote') remote = html_options.delete('remote')
method = html_options.delete('method').to_s method = html_options.delete('method').to_s
method_tag = %w{patch put delete}.include?(method) ? method_tag(method) : ''.html_safe method_tag = BUTTON_TAG_METHOD_VERBS.include?(method) ? method_tag(method) : ''.html_safe
form_method = method == 'get' ? 'get' : 'post' form_method = method == 'get' ? 'get' : 'post'
form_options = html_options.delete('form') || {} form_options = html_options.delete('form') || {}