Class: Course::Admin::Assessments::TabsController

Inherits:
Controller
  • Object
show all
Defined in:
app/controllers/course/admin/assessments/tabs_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject


17
18
19
20
21
22
23
24
# File 'app/controllers/course/admin/assessments/tabs_controller.rb', line 17

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

#destroyObject


26
27
28
29
30
31
32
33
34
35
36
# File 'app/controllers/course/admin/assessments/tabs_controller.rb', line 26

def destroy
  if @tab.destroy
    Course::Settings::AssessmentsComponent.delete_lesson_plan_item_setting(current_course,
                                                                           @tab.id)
    redirect_to course_admin_assessments_path(current_course),
                success: t('.success', title: @tab.title)
  else
    redirect_to course_admin_assessments_path(current_course),
                danger: t('.failure', error: @tab.errors.full_messages.to_sentence)
  end
end

#newObject


14
15
# File 'app/controllers/course/admin/assessments/tabs_controller.rb', line 14

def new
end