Class: ActiveStorageDashboard::ApplicationController
- Inherits:
-
Object
- Object
- ActiveStorageDashboard::ApplicationController
- Defined in:
- app/controllers/active_storage_dashboard/application_controller.rb
Direct Known Subclasses
AttachmentsController, BlobsController, DashboardController, VariantRecordsController
Instance Method Summary collapse
Instance Method Details
#paginate(scope, per_page = 20) ⇒ Object
10 11 12 13 |
# File 'app/controllers/active_storage_dashboard/application_controller.rb', line 10 def paginate(scope, per_page = 20) @page = [params[:page].to_i, 1].max scope.limit(per_page).offset((@page - 1) * per_page) end |