Class: Orchestrator::Api::ZonesController
- Inherits:
-
Orchestrator::ApiController
- Object
- ActionController::Base
- Base
- Orchestrator::ApiController
- Orchestrator::Api::ZonesController
- Defined in:
- app/controllers/orchestrator/api/zones_controller.rb
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#create ⇒ Object
30 31 32 33 |
# File 'app/controllers/orchestrator/api/zones_controller.rb', line 30 def create zone = Zone.new(safe_params) save_and_respond zone end |
#destroy ⇒ Object
35 36 37 38 39 |
# File 'app/controllers/orchestrator/api/zones_controller.rb', line 35 def destroy # delete will update CS and zone caches @zone.delete render :nothing => true end |
#index ⇒ Object
14 15 16 17 18 19 |
# File 'app/controllers/orchestrator/api/zones_controller.rb', line 14 def index query = @@elastic.query(params) query.sort = [{name: "asc"}] respond_with @@elastic.search(query) end |
#show ⇒ Object
21 22 23 |
# File 'app/controllers/orchestrator/api/zones_controller.rb', line 21 def show respond_with @zone end |
#update ⇒ Object
25 26 27 28 |
# File 'app/controllers/orchestrator/api/zones_controller.rb', line 25 def update @zone.update_attributes(safe_params) save_and_respond @zone end |