Class: Afterparty::DashboardController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/afterparty/dashboard_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



22
23
24
25
26
# File 'app/controllers/afterparty/dashboard_controller.rb', line 22

def destroy
  @job.destroy
  flash[:notice] = "You have successfully destroyed job ##{@job.id}."
  redirect_to afterparty_engine.dashboard_path
end

#indexObject



7
8
9
10
11
12
13
14
# File 'app/controllers/afterparty/dashboard_controller.rb', line 7

def index
  @queues = Afterparty.queues
  if params[:completed]
    @jobs = AfterpartyJob.completed.limit(20)
  else
    @jobs = queue.jobs
  end
end

#runObject



16
17
18
19
20
# File 'app/controllers/afterparty/dashboard_controller.rb', line 16

def run
  queue.run @job
  flash[:notice] = "You successfully completed job ##{@job.id}."
  redirect_to afterparty_engine.dashboard_path(completed: true)
end