mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
Fixing link to group website
This commit is contained in:
@@ -1,11 +1,5 @@
|
||||
module GroupsHelper
|
||||
|
||||
def link_to_url(url, html_options = {})
|
||||
link_to_service 'http://', url, html_options do
|
||||
strip_url url
|
||||
end
|
||||
end
|
||||
|
||||
def link_to_service(baseurl, name, html_options = {})
|
||||
if name.empty? then return end
|
||||
html_options = html_options.merge target: '_blank'
|
||||
|
||||
@@ -12,9 +12,8 @@
|
||||
Email us
|
||||
- if @group.website.present?
|
||||
%p
|
||||
%a{href:"http://"+@group.website, target: "_blank"}
|
||||
=link_to_service "http://", @group.website do
|
||||
Visit our website
|
||||
/ =link_to_url @group.website
|
||||
|
||||
%div{bindonce: true}
|
||||
- if @group.facebook.present? || @group.twitter.present? || @group.linkedin.present? || @group.instagram.present?
|
||||
|
||||
@@ -14,10 +14,4 @@ describe GroupsHelper do
|
||||
expect(helper.strip_url("example.com")).to eq("example.com")
|
||||
end
|
||||
end
|
||||
describe "link_to_url" do
|
||||
it "gives a link to an html external url" do
|
||||
expect(helper.link_to_url("example.com")).to eq('<a href="http://example.com" target="_blank">example.com</a>')
|
||||
expect(helper.link_to_url("https://example.com/")).to eq('<a href="https://example.com/" target="_blank">example.com/</a>')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user