aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/url_helper.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2010-10-14 10:25:43 +0100
committerJon Leighton <j@jonathanleighton.com>2010-10-14 10:25:43 +0100
commit3fb493c2b037ffbdda5c91d66334ec6f79faa2d1 (patch)
treee49b072103bbfe6fb6159954c786a31f44099325 /actionpack/lib/action_view/helpers/url_helper.rb
parent212fdd8ba9624f61421a7a950283537a3d39ac18 (diff)
parent01ab6f961bff150d50c99f03fa3946f48ac29b17 (diff)
downloadrails-3fb493c2b037ffbdda5c91d66334ec6f79faa2d1.tar.gz
rails-3fb493c2b037ffbdda5c91d66334ec6f79faa2d1.tar.bz2
rails-3fb493c2b037ffbdda5c91d66334ec6f79faa2d1.zip
Merge branch 'master' into nested_has_many_through
Conflicts: activerecord/lib/active_record/associations.rb activerecord/test/cases/associations/cascaded_eager_loading_test.rb
Diffstat (limited to 'actionpack/lib/action_view/helpers/url_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index da42d94318..c007cac47f 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -587,10 +587,12 @@ module ActionView
html_options = html_options.stringify_keys
html_options['data-remote'] = 'true' if link_to_remote_options?(options) || link_to_remote_options?(html_options)
+ disable_with = html_options.delete("disable_with")
confirm = html_options.delete('confirm')
method = html_options.delete('method')
- add_confirm_to_attributes!(html_options, confirm) if confirm
+ 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
@@ -601,13 +603,9 @@ module ActionView
options.is_a?(Hash) && options.key?('remote') && options.delete('remote')
end
- def add_confirm_to_attributes!(html_options, confirm)
- html_options["data-confirm"] = confirm if confirm
- end
-
def add_method_to_attributes!(html_options, method)
- html_options["rel"] = "nofollow" if method && method.to_s.downcase != "get"
- html_options["data-method"] = method if method
+ html_options["rel"] = "nofollow" if method.to_s.downcase != "get"
+ html_options["data-method"] = method
end
def options_for_javascript(options)