Class: Whenever::JobsController

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/whenever/jobs_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



3
4
5
# File 'app/controllers/whenever/jobs_controller.rb', line 3

def index
  @crontab = CommandLine.new.send(:read_crontab)
end

#runObject



7
8
9
10
11
# File 'app/controllers/whenever/jobs_controller.rb', line 7

def run
  runner = JobRunner.new(params[:id])
  runner.run
  redirect_to jobs_path, notice: t('.success', command: runner.command)
end