Class: Students::CourseEnrollmentsController
- Inherits:
-
GakuController
- Object
- GakuController
- Students::CourseEnrollmentsController
- Defined in:
- app/controllers/gaku/students/course_enrollments_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
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 |
#destroy ⇒ Object
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 |
#index ⇒ Object
20 21 22 |
# File 'app/controllers/gaku/students/course_enrollments_controller.rb', line 20 def index @course_enrollments = @student.course_enrollments end |
#new ⇒ Object
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 |