Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2014-05-29 14:49:15 +0400
committerMarin Jankovski <marin@gitlab.com>2014-05-29 14:49:15 +0400
commit3910b5917c84875f94f8b15594e4c506a3de39cc (patch)
tree8d6d01b837145c977d861e0666afff76ee0f2866 /app/helpers
parent749d198f10fe031d56fda540788148eeaa906bc8 (diff)
Extend default link_to helper to add noreferrer html_option.
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 5f07cdf448c..4a3b345bdfe 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -231,4 +231,18 @@ module ApplicationHelper
content_tag(:i, nil, class: 'icon-spinner icon-spin') + text
end
end
+
+ def link_to(name = nil, options = nil, html_options = nil, &block)
+ if html_options
+ if html_options[:rel]
+ html_options[:rel] << " noreferrer"
+ else
+ html_options.merge(rel: "noreferrer")
+ end
+ else
+ html_options = Hash.new
+ html_options[:rel] = "noreferrer"
+ end
+ super
+ end
end