I have two models. One model is LessonHours, which is responsible for guiding the school classes. This model has weekday, start time and end time fields. The school's admin will register each lesson hour. For example, on monday, there'll be 5 classes, beginning at 8 AM, 8:50 AM, 9:40 AM and 10:30 AM. There'll be a register for each class.
The other model I have is the Teacher model. When we register the teacher, I need to tell the application what is his availability. So I need to show all Lesson Hours, divided by weekdays, so the admin can check its avaiability (ex: monday: 8 AM, 8:50 AM, tuesday: 10:30 AM, etc)
What's the best way to do it?
Thanks in advance!
I guess this can be achieved by has_many :through Association concept
For more example please refer http://guides.rubyonrails.org/association_basics.html#the-has-many-through-association