aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJosh <jdeseno@gmail.com>2011-06-20 22:17:53 -0700
committerJosh <jdeseno@gmail.com>2011-06-20 22:17:53 -0700
commit40e6f437e8197f9fa5ad6c9ce87c9ec062b889bf (patch)
tree0ef80b1006b434ee0829a840026528d5fbc978d6 /actionpack
parent8a889dd45e088014c77f4cd799c9e5ddea0b54c6 (diff)
downloadrails-40e6f437e8197f9fa5ad6c9ce87c9ec062b889bf.tar.gz
rails-40e6f437e8197f9fa5ad6c9ce87c9ec062b889bf.tar.bz2
rails-40e6f437e8197f9fa5ad6c9ce87c9ec062b889bf.zip
Allow additional link relations when using method attribute with link_to
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index 489b96856d..8cb22df280 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -619,7 +619,9 @@ module ActionView
end
def add_method_to_attributes!(html_options, method)
- html_options["rel"] = "nofollow" if method.to_s.downcase != "get"
+ if method && method.to_s.downcase != "get"
+ html_options["rel"] = "#{html_options["rel"].to_s} nofollow".split(" ").uniq.join(" ")
+ end
html_options["data-method"] = method
end