module RedminePluginKit::Helpers::GlobalHelper
Public Instance Methods
link_to_external(name, link, **options)
click to toggle source
# File lib/redmine_plugin_kit/helpers/global_helper.rb, line 6 def link_to_external(name, link, **options) options[:class] ||= 'external' options[:class] = "#{options[:class]} external" if options[:class].exclude? 'external' options[:rel] ||= 'noopener noreferrer' link_to name, link, **options end
link_to_url(url, **options)
click to toggle source
# File lib/redmine_plugin_kit/helpers/global_helper.rb, line 14 def link_to_url(url, **options) return if url.blank? parts = url.split '://' name = if parts.count.positive? parts.shift parts.join else url end link_to_external name, url, **options end