Class: ForemanOrchestration::StackTemplatesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ForemanOrchestration::StackTemplatesController
- Defined in:
- app/controllers/foreman_orchestration/stack_templates_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
TODO: there is an API for template validation: developer.openstack.org/api-ref-orchestration-v1.html#template_validate Maybe we can use it here?.
- #destroy ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #update ⇒ Object
-
#with_params ⇒ Object
ajax methods.
Instance Method Details
#create ⇒ Object
TODO: there is an API for template validation: developer.openstack.org/api-ref-orchestration-v1.html#template_validate Maybe we can use it here?
16 17 18 19 20 21 22 23 |
# File 'app/controllers/foreman_orchestration/stack_templates_controller.rb', line 16 def create @template = StackTemplate.new(template_params) if @template.save process_success object: @template else process_error object: @template end end |
#destroy ⇒ Object
33 34 35 36 37 38 39 |
# File 'app/controllers/foreman_orchestration/stack_templates_controller.rb', line 33 def destroy if @template.destroy process_success object: @template else process_error object: @template end end |
#index ⇒ Object
5 6 7 |
# File 'app/controllers/foreman_orchestration/stack_templates_controller.rb', line 5 def index @templates = StackTemplate.order(:name).all end |
#new ⇒ Object
9 10 11 |
# File 'app/controllers/foreman_orchestration/stack_templates_controller.rb', line 9 def new @template = StackTemplate.new end |
#update ⇒ Object
25 26 27 28 29 30 31 |
# File 'app/controllers/foreman_orchestration/stack_templates_controller.rb', line 25 def update if @template.update_attributes(template_params) process_success object: @template else process_error object: @template end end |
#with_params ⇒ Object
ajax methods
42 43 44 |
# File 'app/controllers/foreman_orchestration/stack_templates_controller.rb', line 42 def with_params render partial: 'with_params', locals: {template: @template, parameters: {}} end |