Module: RailsGallery::ViewHelper::Responsive

Defined in:
lib/rails-gallery/view_helper/responsive.rb

Instance Method Summary collapse

Instance Method Details

#respgal_image(photo, options = {}) ⇒ Object Also known as: responsive_gallery_image



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/rails-gallery/view_helper/responsive.rb', line 4

def respgal_image photo, options = {}
  options.merge! :alt => photo.alt
  options.merge! :"data-large" => photo.path, :"data-description" => photo.title
  return image_tag photo.thumb, options unless options.delete :wrap
  
   :li do
     :a, href: '#' do
      image_tag(photo.thumb, options)
    end
  end          
end

#respgal_imageset(photo, options = {}) ⇒ Object Also known as: responsive_gallery_imageset



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rails-gallery/view_helper/responsive.rb', line 16

def respgal_imageset photo, options = {}
  options.merge! :alt => photo.alt
  options.merge! :"data-large" => photo.path, :"data-description" => photo.title
  options.merge! :srcset => srcset if photo.srcset?
  return imageset_tag photo.thumb, options unless options.delete :wrap
  
   :li do
     :a, href: '#' do
      imageset_tag(photo.thumb, options)
    end
  end
end