How do I structure the model associations so that I can @patient.family.patient[0].name?
I don’t think you have the tables quite right.
I think you need Patient belongs_to family (so patients table will
have family_id field) and family has_many patients. Family needs only
id field (plus other stuff I assume).
Then you can use @patient.family.patients[0].name. Note patients is
plural here.
Colin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.