aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorErik St. Martin <alakriti@gmail.com>2010-01-25 19:48:39 -0500
committerStefan Penner <stefan.penner@gmail.com>2010-01-27 12:44:34 -0600
commit44542bd7daf03057fe502f21f3eb2a5c09ffea57 (patch)
tree9c1d03e583999f64c62f92b46ec53acf000977af /actionpack/lib
parent04ad12d681b13569628f95b44fb13953305e4ddf (diff)
downloadrails-44542bd7daf03057fe502f21f3eb2a5c09ffea57.tar.gz
rails-44542bd7daf03057fe502f21f3eb2a5c09ffea57.tar.bz2
rails-44542bd7daf03057fe502f21f3eb2a5c09ffea57.zip
account for the fact a few options may be passed as symbols and need to be converted to string
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/ajax_helper.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/ajax_helper.rb b/actionpack/lib/action_view/helpers/ajax_helper.rb
index adb686aad4..52b7db4de9 100644
--- a/actionpack/lib/action_view/helpers/ajax_helper.rb
+++ b/actionpack/lib/action_view/helpers/ajax_helper.rb
@@ -291,7 +291,7 @@ module ActionView
# :href => url_for(:action => "destroy", :id => post.id)
def link_to_remote(name, options, html_options = {})
attributes = {}
- attributes.merge!(:rel => "nofollow") if options[:method] && options[:method].downcase == "delete"
+ attributes.merge!(:rel => "nofollow") if options[:method] && options[:method].to_s.downcase == "delete"
attributes.merge!(extract_remote_attributes!(options))
if confirm = options.delete(:confirm)
@@ -512,8 +512,13 @@ module ActionView
def extract_request_attributes!(options)
attributes = {}
- attributes["data-method"] = options.delete(:method)
- attributes["data-remote-type"] = options.delete(:type)
+ if method = options.delete(:method)
+ attributes["data-method"] = method.to_s
+ end
+
+ if type = options.delete(:type)
+ attributes["data-remote-type"] = type.to_s
+ end
url_options = options.delete(:url)
url_options = url_options.merge(:escape => false) if url_options.is_a?(Hash)
@@ -531,7 +536,10 @@ module ActionView
else
attributes["data-update-success"] = update
end
- attributes["data-update-position"] = options.delete(:position)
+
+ if position = options.delete(:position)
+ attributes["data-update-position"] = position.to_s
+ end
purge_unused_attributes!(attributes)
end