Following the example models from the guide
https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association
you would do something like:

@physician.appointments.create(patient: @patient)


El sáb., 5 oct. 2019 a las 19:19, fugee ohu (<[email protected]>) escribió:

> how do i add rows to the associations table in a has_many_through relation
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/47cab85e-cb43-483b-b16b-453880c44ca0%40googlegroups.com
> <https://groups.google.com/d/msgid/rubyonrails-talk/47cab85e-cb43-483b-b16b-453880c44ca0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcCwzk_qhxwXoFx6UzsYVDGqjo4abZCmiWi2qhESkqOMug%40mail.gmail.com.

Reply via email to