Sha256: b3bcb6154d7e93e788ffda8b7121d6aaade1cf1db1862f47c9be0e57503bf433

Contents?: true

Size: 564 Bytes

Versions: 2

Compression:

Stored size: 564 Bytes

Contents

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

  private

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

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

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tramway-profiles-1.0.1 app/helpers/tramway/profiles/links_helper.rb
tramway-profiles-1.0 app/helpers/tramway/profiles/links_helper.rb