I found some SO questions about Rails associations that seem like my question, but for my life I can't figure out how to use belongs_to several models.
Here is the table structure that I intend to have:
User id Post id user_id
And associations:
User has_many :posts has_many :comments Post belongs_to :user has_many :comments Comment belongs_to :user belongs_to :post
Is this the right approach?
ruby-on-rails activerecord belongs-to
Zabba Oct 12 '10 at 5:22 2010-10-12 05:22
source share