Class: Course::Condition::LevelsController

Inherits:
Course::ConditionsController show all
Defined in:
app/controllers/course/condition/levels_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


10
11
12
13
14
15
16
17
18
# File 'app/controllers/course/condition/levels_controller.rb', line 10

def create
  @level_condition.conditional = @conditional

  if @level_condition.save
    redirect_to return_to_path, success: t('course.condition.levels.create.success')
  else
    render :new
  end
end

#destroyObject


31
32
33
34
35
36
37
# File 'app/controllers/course/condition/levels_controller.rb', line 31

def destroy
  if @level_condition.destroy
    redirect_to return_to_path, success: t('course.condition.levels.destroy.success')
  else
    redirect_to return_to_path, danger: t('course.condition.levels.destroy.error')
  end
end

#editObject


20
21
# File 'app/controllers/course/condition/levels_controller.rb', line 20

def edit
end

#newObject


7
8
# File 'app/controllers/course/condition/levels_controller.rb', line 7

def new
end

#updateObject


23
24
25
26
27
28
29
# File 'app/controllers/course/condition/levels_controller.rb', line 23

def update
  if @level_condition.update_attributes(level_condition_params)
    redirect_to return_to_path, success: t('course.condition.levels.update.success')
  else
    render :edit
  end
end