Class: Decidim::ImagesPanelCell

Inherits:
ViewModel
  • Object
show all
Defined in:
app/cells/decidim/images_panel_cell.rb

Overview

This cell is used to render the images panel of a resource inside a tab of a show view

The model must be a resource to get the images from and is expected to respond to photos method

Example:

cell(
"decidim/images_panel",
meeting
)

Instance Method Summary collapse

Instance Method Details

#photosObject



25
26
27
# File 'app/cells/decidim/images_panel_cell.rb', line 25

def photos
  @photos ||= resource.try(:photos)
end

#showObject



19
20
21
22
23
# File 'app/cells/decidim/images_panel_cell.rb', line 19

def show
  return if photos.blank?

  render
end