diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-06 16:44:30 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-06 16:44:30 -0700 |
commit | 410d376d3c78e6b7740d73bb04dc4a59629518c9 (patch) | |
tree | b5e6c3c1622cd33b56ffe0fb9c5d26f390441148 /actionpack/lib/action_view | |
parent | 86b13b6f54fe0f98ef5452ba149ca9956e4a778a (diff) | |
parent | 6caae0231c11ad89c1eeed3b0f8db8dfcb88c729 (diff) | |
download | rails-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.rb | 7 |
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) |