Module: Integral::GalleryHelper

Included in:
ApplicationHelper
Defined in:
app/helpers/integral/gallery_helper.rb

Overview

Gallery Helper which contains methods used to help render image galleries

Instance Method Summary collapse

Instance Method Details

Renders an image gallery using the provided list



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'app/helpers/integral/gallery_helper.rb', line 21

def render_gallery(list, opts = {})
  opts.reverse_merge!(
    renderer: Integral::SwiperListRenderer,
    item_renderer: Integral::PartialListItemRenderer,
    item_renderer_opts: {
      partial_path: 'integral/shared/gallery/slide',
      wrapper_element: 'div',
      image_version: :large,
      html_classes: 'swiper-slide'
    }
  )

  opts[:renderer].render(list, opts).html_safe
end

Renders a thumbnail gallery



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/helpers/integral/gallery_helper.rb', line 5

def render_thumb_gallery(list, opts = {})
  opts.reverse_merge!(
    renderer: Integral::SwiperListRenderer,
    item_renderer: Integral::PartialListItemRenderer,
    item_renderer_opts: {
      partial_path: 'integral/shared/gallery/thumb_slide',
      wrapper_element: 'div',
      image_version: :small,
      html_classes: 'swiper-slide'
    }
  )

  opts[:renderer].render(list, opts).html_safe
end