My model can be described as following:
One Forum has many Threads. One Thread has many Comments.
Data is not denormalized; i.e. Threads has FK only leading to Forum and Comments has FK leading only to Thread.
What will be “The Rails Way” of selecting specific Threads and then rendering Comments in a template grouped by the thread they belong to?
Read Active Record Associations here.
Define
has_manyandbelongs_torelationships for your Forum<> Thread and Thread<>CommentQuerying using rails interface would be quite easy for you then. Refer here
Selecting commnets of specific threads(grouped by it)