From 211e9c33a760b06521fb08bb86bd40be331c6eac Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Sat, 7 Feb 2015 19:31:16 +1100 Subject: [PATCH] Fixing link to group website --- app/helpers/groups_helper.rb | 6 ------ app/views/groups/_contact.html.haml | 3 +-- spec/helpers/groups_helper_spec.rb | 6 ------ 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb index ba884ec8db..8b6ac9f5fd 100644 --- a/app/helpers/groups_helper.rb +++ b/app/helpers/groups_helper.rb @@ -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' diff --git a/app/views/groups/_contact.html.haml b/app/views/groups/_contact.html.haml index 8a612ae194..458aa81dbe 100644 --- a/app/views/groups/_contact.html.haml +++ b/app/views/groups/_contact.html.haml @@ -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? diff --git a/spec/helpers/groups_helper_spec.rb b/spec/helpers/groups_helper_spec.rb index 89b28ae3fa..69e7a3add4 100644 --- a/spec/helpers/groups_helper_spec.rb +++ b/spec/helpers/groups_helper_spec.rb @@ -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('example.com') - expect(helper.link_to_url("https://example.com/")).to eq('example.com/') - end - end end