Class: Course::Admin::Videos::TabsController

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

Instance Method Summary collapse

Instance Method Details

#createObject


12
13
14
15
16
17
18
19
# File 'app/controllers/course/admin/videos/tabs_controller.rb', line 12

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

#destroyObject


21
22
23
24
25
26
27
28
29
# File 'app/controllers/course/admin/videos/tabs_controller.rb', line 21

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

#newObject


10
# File 'app/controllers/course/admin/videos/tabs_controller.rb', line 10

def new; end