Class: TasksController

Inherits:
ApplicationController show all
Defined in:
app/controllers/tasks_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#api_request?, #welcome

Methods included from Foreman::ThreadSession::Cleaner

#clear_thread, included

Instance Method Details

#showObject


4
5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/tasks_controller.rb', line 4

def show
  id = params[:id]
  queue = Rails.cache.fetch(id)
  respond_to do |format|
    format.html {
      @tasks = queue.nil? ? [] : JSON(queue)
      return render :partial => 'list' if ajax?
    }
    format.json { render :json => queue }
  end
end