Class: Students::CourseEnrollmentsController

Inherits:
GakuController
  • Object
show all
Defined in:
app/controllers/gaku/students/course_enrollments_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



14
15
16
17
18
# File 'app/controllers/gaku/students/course_enrollments_controller.rb', line 14

def create
  @course_enrollment = @student.course_enrollments.create(enrollment_params)
  set_count
  respond_with @course_enrollment
end

#destroyObject



24
25
26
27
28
29
# File 'app/controllers/gaku/students/course_enrollments_controller.rb', line 24

def destroy
  @course_enrollment = Gaku::Enrollment.find(params[:id])
  @course_enrollment.destroy!
  set_count
  respond_with @course_enrollment
end

#indexObject



20
21
22
# File 'app/controllers/gaku/students/course_enrollments_controller.rb', line 20

def index
  @course_enrollments = @student.course_enrollments
end

#newObject



9
10
11
12
# File 'app/controllers/gaku/students/course_enrollments_controller.rb', line 9

def new
  @course_enrollment = @student.course_enrollments.build
  respond_with @course_enrollment
end