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



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

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

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

#showObject

Raises:

  • (ActionController::RoutingError)


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

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