Sha256: d72a57ded6e79c834088b765ca37d2713f83a5fadfb88664160bf45a2ccd8da9

Contents?: true

Size: 296 Bytes

Versions: 5

Compression:

Stored size: 296 Bytes

Contents

module FamilyGallery::UsersHelper
  def link_to_user(user, args = {})
    return "[#{t('.no_user')}]" unless user

    if args[:title].present?
      title = args[:title]
    else
      title = user.name
    end

    link_to title, user, class: "link-to-user", data: {user_id: user.id}
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
family_gallery-0.0.8 app/helpers/family_gallery/users_helper.rb
family_gallery-0.0.7 app/helpers/family_gallery/users_helper.rb
family_gallery-0.0.6 app/helpers/family_gallery/users_helper.rb
family_gallery-0.0.5 app/helpers/family_gallery/users_helper.rb
family_gallery-0.0.4 app/helpers/family_gallery/users_helper.rb