Class: Que::View::JobsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Que::View::JobsController
- Defined in:
- app/controllers/que/view/jobs_controller.rb
Constant Summary collapse
- PER_PAGE =
20
Instance Method Summary collapse
- #destroy ⇒ Object
- #destroy_all ⇒ Object
- #index ⇒ Object
- #reschedule_all ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#destroy ⇒ Object
27 28 29 30 31 32 33 |
# File 'app/controllers/que/view/jobs_controller.rb', line 27 def destroy updated_rows = ::Que::View.delete_job(params[:id]) redirect_to( root_path, notice: updated_rows.empty? ? 'Job is not deleted' : 'Job is deleted' ) end |
#destroy_all ⇒ Object
43 44 45 46 47 48 49 |
# File 'app/controllers/que/view/jobs_controller.rb', line 43 def destroy_all updated_rows = destroy_all_jobs(params[:status]) redirect_to( jobs_path(status: params[:status]), notice: updated_rows.empty? ? 'No jobs deleted' : "#{updated_rows.count} jobs deleted" ) end |
#index ⇒ Object
12 13 14 15 |
# File 'app/controllers/que/view/jobs_controller.rb', line 12 def index @jobs = find_jobs(index_params) paginate end |
#reschedule_all ⇒ Object
35 36 37 38 39 40 41 |
# File 'app/controllers/que/view/jobs_controller.rb', line 35 def reschedule_all updated_rows = reschedule_all_jobs(params[:status], Time.now) redirect_to( jobs_path(status: params[:status]), notice: updated_rows.empty? ? 'No jobs rescheduled' : "#{updated_rows.count} jobs rescheduled" ) end |
#show ⇒ Object
17 |
# File 'app/controllers/que/view/jobs_controller.rb', line 17 def show; end |