Class: ForemanDatacenter::PowerPortTemplatesController
- Inherits:
-
ApplicationController
show all
- Includes:
- Controller::Parameters::PowerPortTemplate
- Defined in:
- app/controllers/foreman_datacenter/power_port_templates_controller.rb
Instance Method Summary
collapse
#action_permission, #controller_permission, #find_resource, #not_found, #resource_class, #resource_class_for, #resource_finder, #resource_name, #resource_scope, #scope_for
Instance Method Details
#create ⇒ Object
13
14
15
16
17
18
19
20
21
|
# File 'app/controllers/foreman_datacenter/power_port_templates_controller.rb', line 13
def create
@power_port_template = ForemanDatacenter::PowerPortTemplate.new(power_port_template_params.merge(device_type_id: params[:device_type_id]))
if @power_port_template.save
process_success success_redirect: device_type_url(@power_port_template.device_type_id)
else
process_error object: @power_port_template
end
end
|
#destroy ⇒ Object
23
24
25
26
27
28
29
|
# File 'app/controllers/foreman_datacenter/power_port_templates_controller.rb', line 23
def destroy
if @power_port_template.destroy
process_success success_redirect: device_type_url(params[:device_type_id])
else
process_error object: @power_port_template
end
end
|