Class: ForemanDatacenter::DeviceRolesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ForemanDatacenter::DeviceRolesController
- Defined in:
- app/controllers/foreman_datacenter/device_roles_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/foreman_datacenter/device_roles_controller.rb', line 19 def create @device_role = DeviceRole.new(device_role_params) if @device_role.save process_success object: @device_role else process_error object: @device_role end end |
#destroy ⇒ Object
37 38 39 40 41 42 43 |
# File 'app/controllers/foreman_datacenter/device_roles_controller.rb', line 37 def destroy if @device_role.destroy process_success object: @device_role else process_error object: @device_role end end |
#edit ⇒ Object
16 17 |
# File 'app/controllers/foreman_datacenter/device_roles_controller.rb', line 16 def edit end |
#index ⇒ Object
5 6 7 |
# File 'app/controllers/foreman_datacenter/device_roles_controller.rb', line 5 def index @device_roles = DeviceRole.includes(:devices).all end |
#new ⇒ Object
12 13 14 |
# File 'app/controllers/foreman_datacenter/device_roles_controller.rb', line 12 def new @device_role = DeviceRole.new end |
#show ⇒ Object
9 10 |
# File 'app/controllers/foreman_datacenter/device_roles_controller.rb', line 9 def show end |
#update ⇒ Object
29 30 31 32 33 34 35 |
# File 'app/controllers/foreman_datacenter/device_roles_controller.rb', line 29 def update if @device_role.update(device_role_params) process_success object: @device_role else process_error object: @device_role end end |