Class: Elabs::Admin::ReportsController
- Inherits:
-
AdminApplicationController
- Object
- ActionController::Base
- ElabsApplicationController
- AdminApplicationController
- Elabs::Admin::ReportsController
- Defined in:
- app/controllers/elabs/admin/reports_controller.rb
Constant Summary collapse
- DEFAULT_ORDER_FIELD =
'created_at'.freeze
Constants inherited from AdminApplicationController
AdminApplicationController::MAX_ITEMS_PER_PAGE
Instance Method Summary collapse
-
#destroy ⇒ Object
DELETE /reports/1 DELETE /reports/1.json.
-
#index ⇒ Object
GET /reports GET /reports.json.
Instance Method Details
#destroy ⇒ Object
DELETE /reports/1 DELETE /reports/1.json
18 19 20 21 22 23 24 |
# File 'app/controllers/elabs/admin/reports_controller.rb', line 18 def destroy @report.destroy respond_to do |format| format.html { redirect_to admin_reports_url, notice: _('Report was successfully destroyed.') } format.json { head :no_content } end end |
#index ⇒ Object
GET /reports GET /reports.json
10 11 12 13 14 |
# File 'app/controllers/elabs/admin/reports_controller.rb', line 10 def index order = params['order_by'] || self.class::DEFAULT_ORDER_FIELD direction = params['direction'] || 'desc' @reports = Report.order(order => direction).all end |