Class: ForemanDatacenter::DeviceInterfacesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ForemanDatacenter::DeviceInterfacesController
- Defined in:
- app/controllers/foreman_datacenter/device_interfaces_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #new ⇒ Object
- #new_management ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/foreman_datacenter/device_interfaces_controller.rb', line 25 def create @device_interface = DeviceInterface.new(device_interface_params) 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
45 46 47 48 49 50 51 52 |
# File 'app/controllers/foreman_datacenter/device_interfaces_controller.rb', line 45 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
22 23 |
# File 'app/controllers/foreman_datacenter/device_interfaces_controller.rb', line 22 def edit end |
#new ⇒ Object
5 6 7 8 9 10 11 |
# File 'app/controllers/foreman_datacenter/device_interfaces_controller.rb', line 5 def new device = Device.find(params[:device_id]) @device_interface = DeviceInterface.new( device: device, form_factor: DeviceInterface::DEFAULT_FORM_FACTOR ) end |
#new_management ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'app/controllers/foreman_datacenter/device_interfaces_controller.rb', line 13 def new_management @device_interface = DeviceInterface.new( device: Device.find(params[:device_id]), form_factor: DeviceInterface::DEFAULT_FORM_FACTOR, mgmt_only: true ) render :new end |
#update ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'app/controllers/foreman_datacenter/device_interfaces_controller.rb', line 36 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 |