Sha256: a750c028826c2dded21fad0afab333f1f845bd1f670c80aa388967591e69549a

Contents?: true

Size: 1.25 KB

Versions: 9

Compression:

Stored size: 1.25 KB

Contents

require_dependency "integration_pal/application_controller"

module IntegrationPal
  class JobsController < ApplicationController
    before_action :set_job, only: [:show, :edit, :update, :destroy]

    # GET /jobs
    def index
      @jobs = Job.order('created_at DESC')
    end

    # GET /jobs/1
    def show
    end

    # GET /jobs/new
    def new
      @job = Job.new
    end

    # GET /jobs/1/edit
    def edit
    end

    # POST /jobs
    def create
      @job = Job.new(job_params)

      if @job.save
        redirect_to @job, notice: 'Job was successfully created.'
      else
        render :new
      end
    end

    # PATCH/PUT /jobs/1
    def update
      if @job.update(job_params)
        redirect_to @job, notice: 'Job was successfully updated.'
      else
        render :edit
      end
    end

    # DELETE /jobs/1
    def destroy
      @job.destroy
      redirect_to jobs_url, notice: 'Job was successfully destroyed.'
    end

    private
      # Use callbacks to share common setup or constraints between actions.
      def set_job
        @job = Job.find(params[:id])
      end

      # Only allow a trusted parameter "white list" through.
      def job_params
        params.require(:job).permit(:status, :progress, :worker_id)
      end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
integration_pal-0.2.3 app/controllers/integration_pal/jobs_controller.rb
integration_pal-0.2.2 app/controllers/integration_pal/jobs_controller.rb
integration_pal-0.2.1 app/controllers/integration_pal/jobs_controller.rb
integration_pal-0.2.0 app/controllers/integration_pal/jobs_controller.rb
integration_pal-0.1.6 app/controllers/integration_pal/jobs_controller.rb
integration_pal-0.1.5 app/controllers/integration_pal/jobs_controller.rb
integration_pal-0.1.4 app/controllers/integration_pal/jobs_controller.rb
integration_pal-0.1.3 app/controllers/integration_pal/jobs_controller.rb
integration_pal-0.1.2 app/controllers/integration_pal/jobs_controller.rb