- Ruby
- Rails
- Clone the repository:
git clone <repository_url>
cd <project_directory>
bundle install
bin/dev
class Course < ApplicationRecord
belongs_to :teacher
has_many :enrollments
has_many :students, through: :enrollments
validates :name, presence: true
end
class Teacher < ApplicationRecord
has_many :courses
validates :name, presence: true
end
class Student < ApplicationRecord
has_many :enrollments
has_many :courses, through: :enrollments
validates :name, presence: true
end
class Enrollment < ApplicationRecord
belongs_to :course
belongs_to :student
validates :grade, presence: true
end
Choose at least 3 out of the 5 points to complete in 45 minutes.
- Create a Form for
Course registrations
that allows you to create a Course and its associated Teacher at the same time. Use a Form object approach to represent the Course Registration interface instead of nested params. - Add a Search bar to the Courses index that will allow searching by course name and subject. (Feel free to add gems as needed)
- Set up a job to send students their grades when the course finishes (end_date). Consider that more than one course could end on the same date.
- Create a form for Course metrics that will allow you to select a course, and submit and that will produce the following metrics: course grade average, top 5 students and failed students (less than a 70 grade).
- Add a button to the Courses index named "Compute Grades". The button will schedule a job to calculate the average grades of each curse and send through a turbo broadcast update the index to show the average for each course.