Class: Decidim::LinkedResourcesForCell

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

Overview

This cell is used to render a collection of linked resources for a resource. It’s 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



32
33
34
35
36
# File 'decidim-core/app/cells/decidim/linked_resources_for_cell.rb', line 32

def show
  return if linked_resources.blank?

  render :show
end