Module: Tramway::Profiles::LinksHelper

Defined in:
app/helpers/tramway/profiles/links_helper.rb

Constant Summary collapse

DOMAINS =
{
  vk: 'vk.com',
  facebook: 'facebook.com',
  twitter: 'twitter.com',
  instagram: 'instagram.com',
  telegram: 'intg.me',
  patreon: 'patreon.com'
}.with_indifferent_access

Instance Method Summary collapse

Instance Method Details



4
5
6
# File 'app/helpers/tramway/profiles/links_helper.rb', line 4

def profile_link(profile)
  profile_link_template profile.title, profile_url(profile), profile.network_name
end

#profile_url(profile) ⇒ Object



17
18
19
# File 'app/helpers/tramway/profiles/links_helper.rb', line 17

def profile_url(profile)
  "https://#{DOMAINS[profile.network_name]}/#{profile.uid}"
end