From cb8348b56f95d08cc1304733ba2531b41ec90926 Mon Sep 17 00:00:00 2001 From: kennyj Date: Sat, 1 Jun 2013 13:48:10 +0900 Subject: Remove :confirm and :disable_with options from ActionView::Helpers::FormTagHelper were deprecated. --- .../lib/action_view/helpers/form_tag_helper.rb | 41 ---------------------- actionpack/test/template/form_tag_helper_test.rb | 28 --------------- 2 files changed, 69 deletions(-) diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index c10566a87d..3fa7696b83 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -426,22 +426,6 @@ module ActionView def submit_tag(value = "Save changes", options = {}) options = options.stringify_keys - if disable_with = options.delete("disable_with") - message = ":disable_with option is deprecated and will be removed from Rails 4.1. " \ - "Use 'data: { disable_with: \'Text\' }' instead." - ActiveSupport::Deprecation.warn message - - options["data-disable-with"] = disable_with - end - - if confirm = options.delete("confirm") - message = ":confirm option is deprecated and will be removed from Rails 4.1. " \ - "Use 'data: { confirm: \'Text\' }' instead'." - ActiveSupport::Deprecation.warn message - - options["data-confirm"] = confirm - end - tag :input, { "type" => "submit", "name" => "commit", "value" => value }.update(options) end @@ -488,22 +472,6 @@ module ActionView options ||= {} options = options.stringify_keys - if disable_with = options.delete("disable_with") - message = ":disable_with option is deprecated and will be removed from Rails 4.1. " \ - "Use 'data: { disable_with: \'Text\' }' instead." - ActiveSupport::Deprecation.warn message - - options["data-disable-with"] = disable_with - end - - if confirm = options.delete("confirm") - message = ":confirm option is deprecated and will be removed from Rails 4.1. " \ - "Use 'data: { confirm: \'Text\' }' instead'." - ActiveSupport::Deprecation.warn message - - options["data-confirm"] = confirm - end - options.reverse_merge! 'name' => 'button', 'type' => 'submit' content_tag :button, content_or_options || 'Button', options, &block @@ -541,15 +509,6 @@ module ActionView # # => def image_submit_tag(source, options = {}) options = options.stringify_keys - - if confirm = options.delete("confirm") - message = ":confirm option is deprecated and will be removed from Rails 4.1. " \ - "Use 'data: { confirm: \'Text\' }' instead'." - ActiveSupport::Deprecation.warn message - - options["data-confirm"] = confirm - end - tag :input, { "alt" => image_alt(source), "type" => "image", "src" => path_to_image(source) }.update(options) end diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb index 6c6a142397..70fc6a588b 100644 --- a/actionpack/test/template/form_tag_helper_test.rb +++ b/actionpack/test/template/form_tag_helper_test.rb @@ -410,15 +410,6 @@ class FormTagHelperTest < ActionView::TestCase ) end - def test_submit_tag_with_deprecated_confirmation - assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use 'data: { confirm: \'Text\' }' instead" do - assert_dom_equal( - %(), - submit_tag("Save", :confirm => "Are you sure?") - ) - end - end - def test_button_tag assert_dom_equal( %(), @@ -477,15 +468,6 @@ class FormTagHelperTest < ActionView::TestCase ) end - def test_button_tag_with_deprecated_confirmation - assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use 'data: { confirm: \'Text\' }' instead" do - assert_dom_equal( - %(), - button_tag("Save", :type => "submit", :confirm => "Are you sure?") - ) - end - end - def test_image_submit_tag_with_confirmation assert_dom_equal( %(), @@ -493,16 +475,6 @@ class FormTagHelperTest < ActionView::TestCase ) end - def test_image_submit_tag_with_deprecated_confirmation - assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use 'data: { confirm: \'Text\' }' instead" do - assert_dom_equal( - %(), - image_submit_tag("save.gif", :confirm => "Are you sure?") - ) - end - end - - def test_color_field_tag expected = %{} assert_dom_equal(expected, color_field_tag("car")) -- cgit v1.2.3