aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-10-06 16:44:30 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-10-06 16:44:30 -0700
commit410d376d3c78e6b7740d73bb04dc4a59629518c9 (patch)
treeb5e6c3c1622cd33b56ffe0fb9c5d26f390441148 /actionpack/lib/action_view
parent86b13b6f54fe0f98ef5452ba149ca9956e4a778a (diff)
parent6caae0231c11ad89c1eeed3b0f8db8dfcb88c729 (diff)
downloadrails-410d376d3c78e6b7740d73bb04dc4a59629518c9.tar.gz
rails-410d376d3c78e6b7740d73bb04dc4a59629518c9.tar.bz2
rails-410d376d3c78e6b7740d73bb04dc4a59629518c9.zip
Merge pull request #7864 from teleological/link_to_remote_master
Accept :remote as symbol in link_to options
Diffstat (limited to 'actionpack/lib/action_view')
-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)