From 621ed494f573c4e37c1f7d37cc8741cc4c502827 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Thu, 24 Dec 2015 08:02:57 +0900 Subject: fix TypeError when using submit_tag with Symbol value --- actionview/lib/action_view/helpers/form_tag_helper.rb | 2 +- actionview/test/template/form_tag_helper_test.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'actionview') diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index 0191064326..79a1a242bf 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -447,7 +447,7 @@ module ActionView unless tag_options["data-disable-with"] == false || (tag_options["data"] && tag_options["data"][:disable_with] == false) disable_with_text = tag_options["data-disable-with"] disable_with_text ||= tag_options["data"][:disable_with] if tag_options["data"] - disable_with_text ||= value.clone + disable_with_text ||= value.to_s.clone tag_options.deep_merge!("data" => { "disable_with" => disable_with_text }) else tag_options["data"].delete(:disable_with) if tag_options["data"] diff --git a/actionview/test/template/form_tag_helper_test.rb b/actionview/test/template/form_tag_helper_test.rb index de1eb89dc5..359ecbc637 100644 --- a/actionview/test/template/form_tag_helper_test.rb +++ b/actionview/test/template/form_tag_helper_test.rb @@ -510,6 +510,13 @@ class FormTagHelperTest < ActionView::TestCase ) end + def test_submit_tag_with_symbol_value + assert_dom_equal( + %(), + submit_tag(:Save) + ) + end + def test_button_tag assert_dom_equal( -- cgit v1.2.3