Class: Course::LessonPlan::EventsController

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


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

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

#destroyObject

:nodoc:


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

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

#updateObject

:nodoc:


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

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