Class: ForemanDatacenter::RackGroupsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/foreman_datacenter/rack_groups_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



19
20
21
22
23
24
25
26
27
# File 'app/controllers/foreman_datacenter/rack_groups_controller.rb', line 19

def create
  @rack_group = RackGroup.new(rack_group_params)

  if @rack_group.save
    process_success object: @rack_group
  else
    process_error object: @rack_group
  end
end

#destroyObject



37
38
39
40
41
42
43
# File 'app/controllers/foreman_datacenter/rack_groups_controller.rb', line 37

def destroy
  if @rack_group.destroy
    process_success object: @rack_group
  else
    process_error object: @rack_group
  end
end

#editObject



16
17
# File 'app/controllers/foreman_datacenter/rack_groups_controller.rb', line 16

def edit
end

#indexObject



5
6
7
# File 'app/controllers/foreman_datacenter/rack_groups_controller.rb', line 5

def index
  @rack_groups = RackGroup.includes(:site, :racks).all
end

#newObject



12
13
14
# File 'app/controllers/foreman_datacenter/rack_groups_controller.rb', line 12

def new
  @rack_group = RackGroup.new
end

#showObject



9
10
# File 'app/controllers/foreman_datacenter/rack_groups_controller.rb', line 9

def show
end

#updateObject



29
30
31
32
33
34
35
# File 'app/controllers/foreman_datacenter/rack_groups_controller.rb', line 29

def update
  if @rack_group.update(rack_group_params)
    process_success object: @rack_group
  else
    process_error object: @rack_group
  end
end