From 89177ba2000d6f587364d7ed8f8bf7ecd92e17cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 1 Aug 2012 15:12:53 -0300 Subject: Revert "Deprecate `:confirm` in favor of `:data => { :confirm => 'Text' }` option" Revert "Deprecate `:disable_with` in favor of `'data-disable-with'` option for `button_to` and `submit_tag` helpers." This reverts commit fc092a9cba5fceec38358072e50e09250cf58840. This reverts commit e9051e20aeb2c666db06b6217954737665878db7. This reverts commit d47d6e7eda3aa3e6aa28d0c17ac6801234bb97d1. This reverts commit 21141e777bdce8534e3755c8de7268324b3d8714. --- .../lib/action_view/helpers/asset_tag_helper.rb | 2 +- .../lib/action_view/helpers/form_tag_helper.rb | 10 --------- actionpack/lib/action_view/helpers/url_helper.rb | 26 +++++++--------------- 3 files changed, 9 insertions(+), 29 deletions(-) (limited to 'actionpack/lib/action_view') diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index 51d5d586bf..88bc6a3728 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -367,7 +367,7 @@ module ActionView end if mouseover = options.delete(:mouseover) - ActiveSupport::Deprecation.warn ":mouseover option is deprecated and will be removed from Rails 4.0" + ActiveSupport::Deprecation.warn ":mouseover options is deprecated and will be removed from Rails 4.0" options[:onmouseover] = "this.src='#{path_to_image(mouseover)}'" options[:onmouseout] = "this.src='#{src}'" diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index ef278939d1..066b98d4a2 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -417,14 +417,10 @@ module ActionView options = options.stringify_keys if disable_with = options.delete("disable_with") - ActiveSupport::Deprecation.warn ":disable_with option is deprecated and will be removed from Rails 4.0. Use 'data-disable-with' instead" - options["data-disable-with"] = disable_with end if confirm = options.delete("confirm") - ActiveSupport::Deprecation.warn ":confirm option is deprecated and will be removed from Rails 4.0. Use ':data => { :confirm => \'Text\' }' instead" - options["data-confirm"] = confirm end @@ -471,14 +467,10 @@ module ActionView options = options.stringify_keys if disable_with = options.delete("disable_with") - ActiveSupport::Deprecation.warn ":disable_with option is deprecated and will be removed from Rails 4.0. Use 'data-disable-with' instead" - options["data-disable-with"] = disable_with end if confirm = options.delete("confirm") - ActiveSupport::Deprecation.warn ":confirm option is deprecated and will be removed from Rails 4.0. Use ':data => { :confirm => \'Text\' }' instead" - options["data-confirm"] = confirm end @@ -514,8 +506,6 @@ module ActionView options = options.stringify_keys if confirm = options.delete("confirm") - ActiveSupport::Deprecation.warn ":confirm option is deprecated and will be removed from Rails 4.0. Use ':data => { :confirm => \'Text\' }' instead" - options["data-confirm"] = confirm end diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index d044afa6e6..1f1cd3cee3 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -301,7 +301,7 @@ module ActionView # #
# # " # - # + # # <%= button_to "Delete Image", { :action => "delete", :id => @image.id }, # :confirm => "Are you sure?", :method => :delete %> # # => "
@@ -317,7 +317,7 @@ module ActionView # # => " # #
# # - # # + # # # #
# #
" # # @@ -333,9 +333,9 @@ module ActionView form_method = method.to_s == 'get' ? 'get' : 'post' form_options = html_options.delete('form') || {} form_options[:class] ||= html_options.delete('form_class') || 'button_to' - + remote = html_options.delete('remote') - + request_token_tag = '' if form_method == 'post' && protect_against_forgery? request_token_tag = tag(:input, :type => "hidden", :name => request_forgery_protection_token.to_s, :value => form_authenticity_token) @@ -350,7 +350,7 @@ module ActionView form_options.merge!(:method => form_method, :action => url) form_options.merge!("data-remote" => "true") if remote - + "#{tag(:form, form_options, true)}
#{method_tag}#{tag("input", html_options)}#{request_token_tag}
".html_safe end @@ -622,19 +622,9 @@ module ActionView confirm = html_options.delete('confirm') method = html_options.delete('method') - if disable_with - ActiveSupport::Deprecation.warn ":disable_with option is deprecated and will be removed from Rails 4.0. Use 'data-disable-with' instead" - - html_options["data-disable-with"] = disable_with - end - - if confirm - ActiveSupport::Deprecation.warn ":confirm option is deprecated and will be removed from Rails 4.0. Use ':data => { :confirm => \'Text\' }' instead" - - html_options["data-confirm"] = confirm - end - - add_method_to_attributes!(html_options, method) if method + html_options["data-disable-with"] = disable_with if disable_with + html_options["data-confirm"] = confirm if confirm + add_method_to_attributes!(html_options, method) if method html_options else -- cgit v1.2.3