I am trying to organize my models so that I get to see in lecture.rb > chapter.rb > lesson.rb. As you can imagine chapter.rb have to be organized by order in the view as well as the nested lesson within chapters.
It is a bit confusing.. My idea so far was to create those models.
class Lecture
has_many :lessons, through: :chapters
has_many :chapters
end
class Chapter
# lecture_id / name / should I use an integer to order it ?
has_many :lessons
belongs_to :lecture
end
class Lesson
# I added a :step which is an integer in order to order them?
belongs_to :lecture
belongs_to :chapter
end
Is there a better way of doing that ? The main purpose is to well organize the lectures.