Sha256: 265dcea91ddee3389041da343f8c18b25c4965f5be2c5c1e29ad0a9ffb1e3e89

Contents?: true

Size: 408 Bytes

Versions: 2

Compression:

Stored size: 408 Bytes

Contents

module Whenever
  class JobsController < ActionController::Base
    before_filter :list_jobs
    layout 'admin'

    def index
    end

    def run
      job = @job_list.web_jobs.fetch(params[:id].to_i)
      `#{job.command}`
      flash[:notice] = job.command
      redirect_to jobs_path
    end

    private

    def list_jobs
      @job_list = WebJobList.new(file: 'config/schedule.rb')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
whenever-web-0.0.4 app/controllers/whenever/jobs_controller.rb
whenever-web-0.0.3 app/controllers/whenever/jobs_controller.rb