Class: Decidim::LinkedResourcesForCell

Inherits:
ViewModel
  • Object
show all
Includes:
Cell::ViewModel::Partial
Defined in:
app/cells/decidim/linked_resources_for_cell.rb

Overview

This cell is used to render a collection of linked resources for a resource. It is based on the equivalent helper method linked_resources_for.

The model must be a resource to get the links from.

Available options

  • :type => The String type fo the resources we want to render. Required.
  • :link_name => The String name of the link between the resources. Required.

Example:

cell(
"decidim/linked_resources_for",
result,
type: :proposals,
link_name: "included_proposals"
)

Instance Method Summary collapse

Instance Method Details

#showObject



29
30
31
32
33
# File 'app/cells/decidim/linked_resources_for_cell.rb', line 29

def show
  return if linked_resources.blank?

  render :show
end