aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-03-26 02:14:34 -0700
committerJosé Valim <jose.valim@gmail.com>2012-03-26 02:14:34 -0700
commit1d59caa975a9919a418a08bbaabfa62f0d9dafcd (patch)
tree1bc251d068675cae9c1c81f3d8a5a9162aa0936e /actionpack
parentadb802e629f8d72afbb917575c9ed511a48a3d15 (diff)
parentf7714eca47c5c57acb08ccbfb35ff224ac4d62b3 (diff)
downloadrails-1d59caa975a9919a418a08bbaabfa62f0d9dafcd.tar.gz
rails-1d59caa975a9919a418a08bbaabfa62f0d9dafcd.tar.bz2
rails-1d59caa975a9919a418a08bbaabfa62f0d9dafcd.zip
Merge pull request #5183 from lest/patch-1
use content_tag in button_to helper
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index 29f556502b..4a641fada3 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -334,7 +334,7 @@ module ActionView
remote = html_options.delete('remote')
method = html_options.delete('method').to_s
- method_tag = %w{patch put delete}.include?(method) ? method_tag(method) : ""
+ method_tag = %w{patch put delete}.include?(method) ? method_tag(method) : ''.html_safe
form_method = method == 'get' ? 'get' : 'post'
form_options = html_options.delete('form') || {}
@@ -347,7 +347,8 @@ module ActionView
html_options = convert_options_to_data_attributes(options, html_options)
html_options.merge!("type" => "submit", "value" => name || url)
- "#{tag(:form, form_options, true)}<div>#{method_tag}#{tag("input", html_options)}#{request_token_tag}</div></form>".html_safe
+ inner_tags = method_tag.safe_concat tag('input', html_options).safe_concat request_token_tag
+ content_tag('form', content_tag('div', inner_tags), form_options)
end