Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #11508 from vipulnsward/extract_constants

Extract verbs array from helper to a contant
  • Loading branch information...
commit eda66d89c74cd573f5c0f24877fe9bf3c6a338ba 2 parents 34b8953 + 30ca90a
@senny senny authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 actionview/lib/action_view/helpers/url_helper.rb
View
4 actionview/lib/action_view/helpers/url_helper.rb
@@ -16,7 +16,7 @@ module UrlHelper
# provided here will only work in the context of a request
# (link_to_unless_current, for instance), which must be provided
# as a method called #request on the context.
-
+ BUTTON_TAG_METHOD_VERBS = %w{patch put delete}
extend ActiveSupport::Concern
include TagHelper
@@ -289,7 +289,7 @@ def button_to(name = nil, options = nil, html_options = nil, &block)
remote = html_options.delete('remote')
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_options = html_options.delete('form') || {}
Please sign in to comment.
Something went wrong with that request. Please try again.