From 71597f9d51887885c826a05d14680e26c86e622f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 18 Jan 2012 20:53:32 -0300 Subject: Extract method_tag --- actionpack/lib/action_view/helpers/url_helper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/helpers/url_helper.rb') diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index 96fc4fa414..56f999f2f5 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -327,7 +327,7 @@ module ActionView method_tag = '' if (method = html_options.delete('method')) && %w{put delete}.include?(method.to_s) - method_tag = tag('input', :type => 'hidden', :name => '_method', :value => method.to_s) + method_tag = method_tag(method) end form_method = method.to_s == 'get' ? 'get' : 'post' @@ -676,6 +676,10 @@ module ActionView tag(:input, :type => "hidden", :name => request_forgery_protection_token.to_s, :value => token) end end + + def method_tag(method) + tag('input', :type => 'hidden', :name => '_method', :value => method.to_s) + end end end end -- cgit v1.2.3