I’m having some major issues with has_many through associations and could really do with some assistance.
In the context of the Ruby On Rails guide example, how would I go about coding a form that for a given physician would list all patients and specifically their appointment times that could then be edited. I would want to be able to edit both the patient name & their appointment date in the same form…..this is essentially the crux of the issue i’m having; editing both models in the same form and having it persist values on both.
If anyone can provide some pointers or a working example it would be really appreciated.
You are describing a problem involving a nested model form(has_many). Try this railscast for info about doing this in rails: http://railscasts.com/episodes/196-nested-model-form-part-1 Of particular interest to you should be the accepts_nested_attributes_for method.