class Question < ActiveRecord::Base
has_and_belongs_to_many :minisections
The query: @question_list = Question.where(all the questions associated with the
subject through the above associations???)
@question_list = @subject.questions
Note, though, that since you have subject has_many questions you also
need question belongs_to subject. Also you need to re-think your
associations as you have two routes to question from subject -
directly through the has_many but also right through the chain of
chapters, etc.
class Question < ActiveRecord::Base
has_and_belongs_to_many :minisections
The query: @question_list = Question.where(all the questions associated with the
subject through the above associations???)
@question_list = @subject.questions
Note, though, that since you have subject has_many questions you also
need question belongs_to subject. Also you need to re-think your
associations as you have two routes to question from subject -
directly through the has_many but also right through the chain of
chapters, etc.
Colin
Thank you!
Dave
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.