Sha256: 156fadda2a73a513165769586872fd79ded88dfc7c0a0db0d1f41fb1973daba0

Contents?: true

Size: 930 Bytes

Versions: 1

Compression:

Stored size: 930 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://intg.me/#{uid}", :telegram
  end

  def patreon(uid, title)
    profile_link_template title, "https://patreon.com/#{uid}", :patreon
  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

1 entries across 1 versions & 1 rubygems

Version Path
tramway-profiles-1.3 app/helpers/tramway/profiles/links_helper.rb