Class: Para::Admin::JobsController
- Inherits:
-
ComponentController
- Object
- ActionController::Base
- Para::ApplicationController
- BaseController
- ComponentController
- Para::Admin::JobsController
- Includes:
- ResourceControllerConcerns
- Defined in:
- app/controllers/para/admin/jobs_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from BaseController
#current_ability, #current_admin
Methods included from BaseHelper
#find_partial_for, #find_relation_name_for, #flash_message, #registered_components_options, #resource_title_for, #template_path_lookup
Methods included from Helpers::ResourceName
Methods inherited from Para::ApplicationController
Instance Method Details
#show ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'app/controllers/para/admin/jobs_controller.rb', line 35 def show @status = ActiveJob::Status.get(params[:id]) respond_to do |format| format.json do if @status.failed? render json: { status: @status.status }, status: 422 else render json: { status: @status.status, progress: @status.progress * 100 } end end format.html do @job = @status[:job_type].constantize.new # Assign job id to allow status to be retrieved, which in our case # allows data persistence though the `#store` method @job.job_id = params[:id] render layout: false end end end |