artist urls in reltags should open in new window by default
This commit is contained in:
@@ -107,13 +107,13 @@ module ApplicationHelper
|
||||
time_tag(time.strftime("%Y-%m-%d %H:%M"), time)
|
||||
end
|
||||
|
||||
def external_link_to(url, truncate: nil, strip_scheme: false)
|
||||
def external_link_to(url, truncate: nil, strip_scheme: false, link_options: {})
|
||||
text = url
|
||||
text = text.gsub(%r!\Ahttps?://!i, "") if strip_scheme
|
||||
text = text.truncate(truncate) if truncate
|
||||
|
||||
if url =~ %r!\Ahttps?://!i
|
||||
link_to text, url, {rel: :nofollow}
|
||||
link_to text, url, {rel: :nofollow}.merge(link_options)
|
||||
else
|
||||
url
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user