Class: Course::Assessment::SkillBranchesController

Inherits:
ComponentController show all
Defined in:
app/controllers/course/assessment/skill_branches_controller.rb

Instance Method Summary collapse

Methods included from ApplicationSignInCallbacksConcern

#sign_in

Methods included from ApplicationPaginationConcern

#page_param

Methods included from ApplicationAnnouncementsConcern

#global_announcements, #unread_global_announcements

Methods included from ApplicationInstanceUserConcern

#current_instance_user

Methods included from ApplicationUserTimeZoneConcern

#set_time_zone

Methods included from ApplicationUserConcern

#handle_access_denied, #publicly_accessible?

Methods included from ApplicationComponentsConcern

#handle_component_not_found

Instance Method Details

#createObject


11
12
13
14
15
16
17
18
# File 'app/controllers/course/assessment/skill_branches_controller.rb', line 11

def create
  if @skill_branch.save
    redirect_to course_assessments_skills_path(current_course),
                success: t('.success', title: @skill_branch.title)
  else
    render 'new'
  end
end

#destroyObject


32
33
34
35
36
37
38
39
40
# File 'app/controllers/course/assessment/skill_branches_controller.rb', line 32

def destroy
  if @skill_branch.destroy
    redirect_to course_assessments_skills_path(current_course),
                success: t('.success', skill: @skill_branch.title)
  else
    redirect_to course_assessments_skills_path(current_course),
                danger: t('.failure', error: @skill_branch.errors.full_messages.to_sentence)
  end
end

#editObject


20
21
# File 'app/controllers/course/assessment/skill_branches_controller.rb', line 20

def edit
end

#newObject


8
9
# File 'app/controllers/course/assessment/skill_branches_controller.rb', line 8

def new
end

#updateObject


23
24
25
26
27
28
29
30
# File 'app/controllers/course/assessment/skill_branches_controller.rb', line 23

def update
  if @skill_branch.update_attributes(skill_branch_params)
    redirect_to course_assessments_skills_path(current_course),
                success: t('.success', title: @skill_branch.title)
  else
    render 'edit'
  end
end