Class: Decidim::Sortitions::SortitionsController

Inherits:
ApplicationController show all
Includes:
Paginable, Orderable, FilterResource
Defined in:
decidim-sortitions/app/controllers/decidim/sortitions/sortitions_controller.rb

Overview

Exposes the sortition resource so users can view them

Constant Summary

Constants included from Paginable

Paginable::OPTIONS

Instance Method Summary collapse

Instance Method Details

#indexObject



16
17
18
19
20
21
22
23
# File 'decidim-sortitions/app/controllers/decidim/sortitions/sortitions_controller.rb', line 16

def index
  @sortitions = search
                .result
                .includes(:category)

  @sortitions = reorder(@sortitions)
  @sortitions = paginate(@sortitions)
end

#showObject

Raises:

  • (ActionController::RoutingError)


25
26
27
# File 'decidim-sortitions/app/controllers/decidim/sortitions/sortitions_controller.rb', line 25

def show
  raise ActionController::RoutingError, "Not Found" unless sortition
end