Class: Api::V1::JobsController
- Inherits:
-
ApiController
- Object
- ApiController
- Api::V1::JobsController
- Defined in:
- app/controllers/integration_pal/api/v1/jobs_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /jobs.
-
#show ⇒ Object
GET /jobs/1.
Instance Method Details
#create ⇒ Object
POST /jobs
12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/integration_pal/api/v1/jobs_controller.rb', line 12 def create @job = Job.new(job_params) if @job.save @job.queue_job render json: @job, status: :ok else render json: {errors: @job.errors}, status: :unprocessable_entity end end |
#show ⇒ Object
GET /jobs/1
6 7 8 9 |
# File 'app/controllers/integration_pal/api/v1/jobs_controller.rb', line 6 def show @job = Job.find(params[:id]) render json: @job, status: :ok end |