Module: FamilyGallery::PicturesHelper

Defined in:
app/helpers/family_gallery/pictures_helper.rb

Instance Method Summary collapse

Instance Method Details

#picture_image_tag(picture, args = {}) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
# File 'app/helpers/family_gallery/pictures_helper.rb', line 2

def picture_image_tag(picture, args = {})
  image_args = {alt: picture.title, class: "picture-image"}.merge(args)

  if args[:group]
    link_object = [args[:group], picture]
  else
    link_object = picture
  end

  link_to(image_tag(picture.image.url, image_args), link_object)
end