Class: Admin::PodsController

Inherits:
AdminController show all
Defined in:
app/controllers/admin/pods_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/admin/pods_controller.rb', line 8

def index
  pods_json = PodPresenter.as_collection(Pod.all)

  respond_with do |format|
    format.html do
      gon.preloads[:pods] = pods_json
      gon.unchecked_count = Pod.unchecked.count
      gon.version_failed_count = Pod.version_failed.count
      gon.error_count = Pod.check_failed.count

      render "admins/pods"
    end
    format.mobile { render "admins/pods" }
    format.json { render json: pods_json }
  end
end

#recheckObject


25
26
27
28
29
30
31
32
33
# File 'app/controllers/admin/pods_controller.rb', line 25

def recheck
  pod = Pod.find(params[:pod_id])
  pod.test_connection!

  respond_with do |format|
    format.html { redirect_to admin_pods_path }
    format.json { render json: PodPresenter.new(pod).as_json }
  end
end