Module: AlbumsHelper

Defined in:
app/helpers/albums_helper.rb

Instance Method Summary collapse

Instance Method Details

Parameters:



3
4
5
# File 'app/helpers/albums_helper.rb', line 3

def admin_album_link(entity)
  link_to(entity.name, admin_album_path(id: entity.id))
end

Parameters:



8
9
10
# File 'app/helpers/albums_helper.rb', line 8

def admin_photo_link(entity)
  link_to(entity.name, admin_photo_path(id: entity.id))
end

#album_image_medium(entity) ⇒ Object

Parameters:



31
32
33
34
35
36
# File 'app/helpers/albums_helper.rb', line 31

def album_image_medium(entity)
  unless entity.image.blank?
    versions = "#{entity.image.medium_2x.url} 2x"
    image_tag(entity.image.medium.url, alt: entity.name, srcset: versions)
  end
end

#album_image_preview(entity) ⇒ Object

Parameters:



23
24
25
26
27
28
# File 'app/helpers/albums_helper.rb', line 23

def album_image_preview(entity)
  unless entity.image.blank?
    versions = "#{entity.image.preview_2x.url} 2x"
    image_tag(entity.image.preview.url, alt: entity.name, srcset: versions)
  end
end

Parameters:



13
14
15
# File 'app/helpers/albums_helper.rb', line 13

def album_link(entity)
  link_to(entity.name, album_path(id: entity.id))
end

Parameters:



18
19
20
# File 'app/helpers/albums_helper.rb', line 18

def photo_link(entity)
  link_to(entity.name, photo_path(id: entity.id))
end