Class: Decidim::Sortitions::Admin::ApplicationController

Inherits:
Admin::Components::BaseController
  • Object
show all
Defined in:
app/controllers/decidim/sortitions/admin/application_controller.rb

Overview

This controller is the abstract class from which all other controllers of this engine inherit.

Note that it inherits from ‘Decidim::Components::BaseController`, which override its layout and provide all kinds of useful methods.

Direct Known Subclasses

SortitionsController

Instance Method Summary collapse

Instance Method Details

#sortitionObject



22
23
24
# File 'app/controllers/decidim/sortitions/admin/application_controller.rb', line 22

def sortition
  @sortition ||= sortitions.find(params[:id])
end

#sortitionsObject



14
15
16
17
18
19
20
# File 'app/controllers/decidim/sortitions/admin/application_controller.rb', line 14

def sortitions
  @sortitions ||= Decidim::Sortitions::FilteredSortitions
                  .for(current_component)
                  .order(created_at: :desc)
                  .page(params[:page])
                  .per(Decidim::Sortitions.items_per_page)
end