aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb2
-rw-r--r--actionpack/test/template/url_helper_test.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index 7d42a2ef69..bd179ef0b3 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -584,7 +584,7 @@ module ActionView
end
def add_method_to_attributes!(html_options, method)
- html_options["rel"] = "nofollow" if method && method.to_s.downcase == "delete"
+ html_options["rel"] = "nofollow" if method && method.to_s.downcase != "get"
html_options["data-method"] = method if method
end
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb
index 6d9384d40b..b498ec8429 100644
--- a/actionpack/test/template/url_helper_test.rb
+++ b/actionpack/test/template/url_helper_test.rb
@@ -192,7 +192,7 @@ class UrlHelperTest < ActionView::TestCase
def test_link_tag_using_post_javascript
assert_dom_equal(
- "<a href='http://www.example.com' data-method=\"post\">Hello</a>",
+ "<a href='http://www.example.com' data-method=\"post\" rel=\"nofollow\">Hello</a>",
link_to("Hello", "http://www.example.com", :method => :post)
)
end
@@ -213,7 +213,7 @@ class UrlHelperTest < ActionView::TestCase
def test_link_tag_using_post_javascript_and_confirm
assert_dom_equal(
- "<a href=\"http://www.example.com\" data-method=\"post\" data-confirm=\"Are you serious?\">Hello</a>",
+ "<a href=\"http://www.example.com\" data-method=\"post\" rel=\"nofollow\" data-confirm=\"Are you serious?\">Hello</a>",
link_to("Hello", "http://www.example.com", :method => :post, :confirm => "Are you serious?")
)
end