Student -< Enrollment >- Course
Student has many enrollments, student has many courses through enrollments Course has many enrollments, course has many students through enrollments Enrollment belongs to a student and a course
-
rails g model Student name age:integer --no-test-framework
-
rails g model Course name teacher_name --no-test-framework
-
rails g controller students index new create show edit update destroy
-
rails g controller courses index
- rails g model Enrollment student_id:integer course_id:integer --no-test-framework
- rails g controller enrollments index new create show destroy
- rails db:migrate
- rails db:seed
- Display all students in the database
- Add new students in the index
- Have a show page for each student
- In the show page, the courses associated with the student are displayed.
- In the show page, we have the ability to update or delete the specific student.
- Ability to register for a new course using form_for and collection_select by creating a new enrollment.
- Ability to drop course by deleting enrollment.