Class: Decidim::Sortitions::SortitionsController

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

Overview

Exposes the sortition resource so users can view them

Instance Method Summary collapse

Instance Method Details

#indexObject



16
17
18
19
20
21
22
23
# File '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 'app/controllers/decidim/sortitions/sortitions_controller.rb', line 25

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