Class: Course::LessonPlan::MilestonesController

Inherits:
Controller show all
Defined in:
app/controllers/course/lesson_plan/milestones_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

:nodoc:


7
8
9
10
11
12
13
# File 'app/controllers/course/lesson_plan/milestones_controller.rb', line 7

def create #:nodoc:
  if @milestone.save
    render partial: 'milestone', locals: { milestone: @milestone }
  else
    render json: { errors: @milestone.errors }, status: :bad_request
  end
end

#destroyObject

:nodoc:


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

def destroy #:nodoc:
  if @milestone.destroy
    head :ok
  else
    head :bad_request
  end
end

#updateObject

:nodoc:


15
16
17
18
19
20
21
# File 'app/controllers/course/lesson_plan/milestones_controller.rb', line 15

def update #:nodoc:
  if @milestone.update_attributes(milestone_params)
    render partial: 'milestone', locals: { milestone: @milestone }
  else
    render json: { errors: @milestone.errors }, status: :bad_request
  end
end