From 9e102c88d6e3327d68f7295bd9ea2d2b236507e3 Mon Sep 17 00:00:00 2001 From: Bruno Michel Date: Mon, 8 Mar 2010 22:57:47 +0100 Subject: [PATCH] button_to should generate an html_safe string --- actionpack/lib/action_view/helpers/url_helper.rb | 4 ++-- actionpack/test/template/url_helper_test.rb | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index bbe0473..74cb448 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -308,8 +308,8 @@ module ActionView html_options.merge!("type" => "submit", "value" => name) - "
" + - method_tag + tag("input", html_options) + request_token_tag + "
".html_safe + ("
" + + method_tag + tag("input", html_options) + request_token_tag + "
").html_safe end diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index 0b0e01a..cf89829 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -88,6 +88,10 @@ class UrlHelperTest < ActionView::TestCase ) end + def test_button_to_returns_an_html_safe_string + assert button_to("Hello", "http://www.example.com").html_safe? + end + def test_link_tag_with_straight_url assert_dom_equal "Hello", link_to("Hello", "http://www.example.com") end -- 1.6.3.3