Module: Locomotive::Shared::AccountsHelper
- Defined in:
- app/helpers/locomotive/shared/accounts_helper.rb
Instance Method Summary collapse
- #account_avatar_and_name(account, size = '70x70#') ⇒ Object
- #account_avatar_url(account, size = '70x70#') ⇒ Object
Instance Method Details
#account_avatar_and_name(account, size = '70x70#') ⇒ Object
13 14 15 16 |
# File 'app/helpers/locomotive/shared/accounts_helper.rb', line 13 def account_avatar_and_name(account, size = '70x70#') avatar = image_tag(account_avatar_url(account, size), class: 'img-circle', style: 'width: 20px') profile = avatar + (account.try(:name) || t(:unknown_account, scope: 'locomotive.dashboard.activity')) end |
#account_avatar_url(account, size = '70x70#') ⇒ Object
5 6 7 8 9 10 11 |
# File 'app/helpers/locomotive/shared/accounts_helper.rb', line 5 def account_avatar_url(account, size = '70x70#') if account && account.avatar? Locomotive::Dragonfly.resize_url account.avatar.url, size else 'locomotive/user.png' end end |