Class: Bumbleworks::Gui::WorkersController

Inherits:
ApplicationController show all
Defined in:
lib/bumbleworks/gui/controllers/workers_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#layout, #set_title

Instance Method Details

#change_global_stateObject



14
15
16
17
18
# File 'lib/bumbleworks/gui/controllers/workers_controller.rb', line 14

def change_global_state
  command = params[:command]
  Bumbleworks::Worker.send("#{command}_all")
  redirect path_to('workers_index')
end

#indexObject



4
5
6
7
# File 'lib/bumbleworks/gui/controllers/workers_controller.rb', line 4

def index
  Bumbleworks::Worker.refresh_worker_info
  expose :workers => Bumbleworks::Worker.info
end

#purge_staleObject



20
21
22
23
# File 'lib/bumbleworks/gui/controllers/workers_controller.rb', line 20

def purge_stale
  Bumbleworks::Worker.purge_stale_worker_info
  redirect path_to('workers_index')
end

#showObject



9
10
11
12
# File 'lib/bumbleworks/gui/controllers/workers_controller.rb', line 9

def show
  Bumbleworks::Worker.refresh_worker_info
  expose :id => params[:id], :info => Bumbleworks::Worker.info[params[:id]]
end