Class: Decidim::Elections::ElectionGCell

Inherits:
CardGCell
  • Object
show all
Includes:
ElectionCellsHelper
Defined in:
app/cells/decidim/elections/election_g_cell.rb

Overview

This cell renders the Grid (:g) election card for a given instance of an Election

Instance Method Summary collapse

Instance Method Details

#has_image?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'app/cells/decidim/elections/election_g_cell.rb', line 14

def has_image?
  model.photos.present?
end

#metadata_cellObject



10
11
12
# File 'app/cells/decidim/elections/election_g_cell.rb', line 10

def 
  "decidim/elections/election_metadata"
end

#resource_image_pathObject



18
19
20
# File 'app/cells/decidim/elections/election_g_cell.rb', line 18

def resource_image_path
  model.photos.first.url if has_image?
end