aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/url_helper.rb
diff options
context:
space:
mode:
authorRiley Lynch <oss@teleological.net>2012-10-06 16:58:27 -0400
committerRiley Lynch <oss@teleological.net>2012-10-06 17:14:10 -0400
commit6caae0231c11ad89c1eeed3b0f8db8dfcb88c729 (patch)
treeb9fdc9f070eea770e7b4df24647764f2b25dfa0d /actionpack/lib/action_view/helpers/url_helper.rb
parentbcbf1bbba439346b9b16e9b3dbc417d4e3abb717 (diff)
downloadrails-6caae0231c11ad89c1eeed3b0f8db8dfcb88c729.tar.gz
rails-6caae0231c11ad89c1eeed3b0f8db8dfcb88c729.tar.bz2
rails-6caae0231c11ad89c1eeed3b0f8db8dfcb88c729.zip
Accept :remote as symbol in link_to options
Accept either :remote or 'remote' in both the html_options and (url_)options hash arguments to link_to.
Diffstat (limited to 'actionpack/lib/action_view/helpers/url_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index 3f65791aa0..e8b3b14265 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -175,9 +175,10 @@ module ActionView
def link_to(name = nil, options = nil, html_options = nil, &block)
html_options, options = options, name if block_given?
options ||= {}
- url = url_for(options)
html_options = convert_options_to_data_attributes(options, html_options)
+
+ url = url_for(options)
html_options['href'] ||= url
content_tag(:a, name || url, html_options, &block)
@@ -598,7 +599,9 @@ module ActionView
end
def link_to_remote_options?(options)
- options.is_a?(Hash) && options.delete('remote')
+ if options.is_a?(Hash)
+ options.delete('remote') || options.delete(:remote)
+ end
end
def add_method_to_attributes!(html_options, method)