Class: Jobs::FailedController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/panoptic/jobs/failed_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/panoptic/jobs/failed_controller.rb', line 17

def destroy
  @job = Panoptic::FailedJob.find(params[:id])
  if @job.destroy
    redirect_back fallback_location: failed_jobs_path,
                  notice: "Job was successfully deleted."
  else
    redirect_back fallback_location: failed_jobs_path,
                  alert: @job.errors.full_messages.to_sentence
  end
end

#indexObject



7
8
9
10
11
# File 'app/controllers/panoptic/jobs/failed_controller.rb', line 7

def index
  @pagy, @jobs = pagy(
    Panoptic::FailedJob.order(created_at: :asc)
  )
end

#showObject



13
14
15
# File 'app/controllers/panoptic/jobs/failed_controller.rb', line 13

def show
  @job = Panoptic::FailedJob.find(params[:id])
end