Files
openfoodnetwork/app/helpers/groups_helper.rb
Luis Ramos e52937c113 Use rubocop auto correct to add frozen string literal to all files
This is an unsafe auto corection, we will need to trust our build here
2021-06-17 23:07:26 +01:00

23 lines
442 B
Ruby

# frozen_string_literal: true
module GroupsHelper
def link_to_service(baseurl, name, html_options = {}, &block)
return if name.blank?
html_options = html_options.merge target: '_blank'
link_to ext_url(baseurl, name), html_options, &block
end
def ext_url(prefix, url)
if url =~ %r{^https?://}i
url
else
prefix + url
end
end
def strip_url(url)
url.andand.sub(%r{^https?://}i, '')
end
end