Skip to content

Commit 3537826

Browse files
committed
We are calling to_s in the method so we can call downcase now
1 parent 1358fce commit 3537826

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

actionview/lib/action_view/helpers/form_tag_helper.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -862,13 +862,13 @@ def html_options_for_form(url_for_options, options)
862862

863863
def extra_tags_for_form(html_options)
864864
authenticity_token = html_options.delete("authenticity_token")
865-
method = html_options.delete("method").to_s
865+
method = html_options.delete("method").to_s.downcase
866866

867867
method_tag = case method
868-
when /^get$/i # must be case-insensitive, but can't use downcase as might be nil
868+
when 'get'
869869
html_options["method"] = "get"
870870
''
871-
when /^post$/i, "", nil
871+
when 'post', ''
872872
html_options["method"] = "post"
873873
token_tag(authenticity_token, form_options: {
874874
action: html_options["action"],

0 commit comments

Comments
 (0)