aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-06-22 20:34:33 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2011-06-22 20:34:33 -0700
commit7f6eed04479bc66eacf8a6d644f063c44670e3ce (patch)
tree15f5e1b4ce2bd03ab9ffcec95ccb3e7464cfd89d /actionpack/lib
parent6b3342d971d4e127dceb351ef983ca650167518e (diff)
parent9c1d0d88a7bab0b0bc0d39748458bbeb327b7725 (diff)
downloadrails-7f6eed04479bc66eacf8a6d644f063c44670e3ce.tar.gz
rails-7f6eed04479bc66eacf8a6d644f063c44670e3ce.tar.bz2
rails-7f6eed04479bc66eacf8a6d644f063c44670e3ce.zip
Merge pull request #1796 from jdeseno/master
link_to doesn't allow rel attribute when also specifying method
Diffstat (limited to 'actionpack/lib')
-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