Class: OrgDepartmentsController

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

Instance Method Summary collapse

Instance Method Details

#createObject

POST /org_departments



23
24
25
26
27
28
29
30
31
# File 'app/controllers/org_departments_controller.rb', line 23

def create
  @org_department = OrgDepartment.new(org_department_params)

  if @org_department.save
    redirect_to @org_department, notice: 'Org department was successfully created.'
  else
    render :new
  end
end

#destroyObject

DELETE /org_departments/1



43
44
45
46
# File 'app/controllers/org_departments_controller.rb', line 43

def destroy
  @org_department.destroy
  redirect_to org_departments_url, notice: 'Org department was successfully destroyed.'
end

#editObject

GET /org_departments/1/edit



19
20
# File 'app/controllers/org_departments_controller.rb', line 19

def edit
end

#indexObject

GET /org_departments



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

def index
  @org_departments = OrgDepartment.all
end

#newObject

GET /org_departments/new



14
15
16
# File 'app/controllers/org_departments_controller.rb', line 14

def new
  @org_department = OrgDepartment.new
end

#showObject

GET /org_departments/1



10
11
# File 'app/controllers/org_departments_controller.rb', line 10

def show
end

#updateObject

PATCH/PUT /org_departments/1



34
35
36
37
38
39
40
# File 'app/controllers/org_departments_controller.rb', line 34

def update
  if @org_department.update(org_department_params)
    redirect_to @org_department, notice: 'Org department was successfully updated.'
  else
    render :edit
  end
end