Class: ForemanDatacenter::DeviceInterfacesController
- Inherits:
-
ApplicationController
show all
- Includes:
- Controller::Parameters::DeviceInterface
- Defined in:
- app/controllers/foreman_datacenter/device_interfaces_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
27
28
29
30
31
32
33
34
35
36
|
# File 'app/controllers/foreman_datacenter/device_interfaces_controller.rb', line 27
def create
@device_interface = ForemanDatacenter::DeviceInterface.new(device_interface_params.merge(device_id: params[:device_id]))
if @device_interface.save
redirect_to device_url(id: @device_interface.device_id),
notice: 'Device interface was successfully created.'
else
process_error object: @device_interface
end
end
|
#destroy ⇒ Object
47
48
49
50
51
52
53
54
|
# File 'app/controllers/foreman_datacenter/device_interfaces_controller.rb', line 47
def destroy
if @device_interface.destroy
redirect_to device_url(id: @device_interface.device_id),
notice: 'Device interface was successfully destroyed.'
else
process_error object: @device_interface
end
end
|
#edit ⇒ Object
24
25
|
# File 'app/controllers/foreman_datacenter/device_interfaces_controller.rb', line 24
def edit
end
|
#update ⇒ Object
38
39
40
41
42
43
44
45
|
# File 'app/controllers/foreman_datacenter/device_interfaces_controller.rb', line 38
def update
if @device_interface.update(device_interface_params)
redirect_to device_url(id: @device_interface.device_id),
notice: 'Device interface was successfully updated.'
else
process_error object: @device_interface
end
end
|