Class: RecoursesController

Inherits:
ApplicationController
  • Object
show all
Includes:
Pagy::Method
Defined in:
app/controllers/recourses_controller.rb

Overview

Base class for recoursive controllers.

Instance Method Summary collapse

Instance Method Details

#indexObject



6
7
8
9
10
11
12
13
# File 'app/controllers/recourses_controller.rb', line 6

def index
  model = controller_name.classify.constantize
  @where = request.path_parameters.except(:controller, :action)
  @order = model.recourse_order
  @includes = model.recourse_includes

  @pagy, @resources = paginate model, where: @where, order: model.recourse_order, includes: model.recourse_includes
end