Commit 3910b5917c84875f94f8b15594e4c506a3de39cc

Authored by Marin Jankovski
1 parent 749d198f

Extend default link_to helper to add noreferrer html_option.

Showing 1 changed file with 14 additions and 0 deletions   Show diff stats
app/helpers/application_helper.rb
... ... @@ -231,4 +231,18 @@ module ApplicationHelper
231 231 content_tag(:i, nil, class: 'icon-spinner icon-spin') + text
232 232 end
233 233 end
  234 +
  235 + def link_to(name = nil, options = nil, html_options = nil, &block)
  236 + if html_options
  237 + if html_options[:rel]
  238 + html_options[:rel] << " noreferrer"
  239 + else
  240 + html_options.merge(rel: "noreferrer")
  241 + end
  242 + else
  243 + html_options = Hash.new
  244 + html_options[:rel] = "noreferrer"
  245 + end
  246 + super
  247 + end
234 248 end
... ...