Class: NextSgad::EmployeeGoalsController

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

Instance Method Summary collapse

Instance Method Details

#createObject

POST /employee_goals



26
27
28
29
30
31
32
33
34
# File 'app/controllers/next_sgad/employee_goals_controller.rb', line 26

def create
  @employee_goal = EmployeeGoal.new(employee_goal_params)

  if @employee_goal.save
    redirect_to @employee_goal, notice: 'Employee goal was successfully created.'
  else
    render :new
  end
end

#destroyObject

DELETE /employee_goals/1



46
47
48
49
# File 'app/controllers/next_sgad/employee_goals_controller.rb', line 46

def destroy
  @employee_goal.destroy
  redirect_to employee_goals_url, notice: 'Employee goal was successfully destroyed.'
end

#editObject

GET /employee_goals/1/edit



22
23
# File 'app/controllers/next_sgad/employee_goals_controller.rb', line 22

def edit
end

#indexObject

GET /employee_goals



8
9
10
# File 'app/controllers/next_sgad/employee_goals_controller.rb', line 8

def index
  @employee_goals = EmployeeGoal.all
end

#newObject

GET /employee_goals/new



17
18
19
# File 'app/controllers/next_sgad/employee_goals_controller.rb', line 17

def new
  @employee_goal = EmployeeGoal.new
end

#showObject

GET /employee_goals/1



13
14
# File 'app/controllers/next_sgad/employee_goals_controller.rb', line 13

def show
end

#updateObject

PATCH/PUT /employee_goals/1



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

def update
  if @employee_goal.update(employee_goal_params)
    redirect_to @employee_goal, notice: 'Employee goal was successfully updated.'
  else
    render :edit
  end
end