Class: Gaku::Api::V1::Courses::EnrollmentsController
- Inherits:
-
BaseController
- Object
- ActionController::API
- ApplicationController
- BaseController
- Gaku::Api::V1::Courses::EnrollmentsController
- Defined in:
- app/controllers/gaku/api/v1/courses/enrollments_controller.rb
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
14 15 16 17 |
# File 'app/controllers/gaku/api/v1/courses/enrollments_controller.rb', line 14 def create @enrollment = @course.enrollments.create(create_enrollment_params) member_respond_to @enrollment end |
#index ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/gaku/api/v1/courses/enrollments_controller.rb', line 8 def index @enrollments = @course.enrollments.page(params[:page ]) collection_respond_to @enrollments, root: :enrollments end |
#update ⇒ Object
19 20 21 22 23 |
# File 'app/controllers/gaku/api/v1/courses/enrollments_controller.rb', line 19 def update @enrollment = Enrollment.find(params[:id]) @enrollment.update!(update_enrollment_params) member_respond_to @enrollment end |