Sha256: 15954b929da39597d05045badb311ca60439864861452ec95bdc3403749d0808

Contents?: true

Size: 827 Bytes

Versions: 2

Compression:

Stored size: 827 Bytes

Contents

module Tramway::Profiles::LinksHelper
  def profile_link(profile)
    send profile.network_name, profile.uid, profile.title
  end

  private

  def vk(uid, title)
    profile_link_template title, "https://vk.com/#{uid}", :vk
  end

  def facebook(uid, title)
    profile_link_template title, "https://facebook.com/#{uid}", :facebook
  end

  def twitter(uid, title)
    profile_link_template title, "https://twitter.com/#{uid}", :twitter
  end

  def instagram(uid, title)
    profile_link_template title, "https://instagram.com/#{uid}", :instagram
  end

  def telegram(uid, title)
    profile_link_template title, "https://teleg.run/#{uid}", :telegram
  end

  def profile_link_template(title, link, icon)
    link_to link, target: '_blank' do
      concat fa_icon icon
      concat ' '
      concat title 
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tramway-profiles-1.2.0.1 app/helpers/tramway/profiles/links_helper.rb
tramway-profiles-1.2 app/helpers/tramway/profiles/links_helper.rb