On Friday, February 2, 2018 at 5:01:05 PM UTC-5, Colin Law wrote:
>> So if I'm using the second approach the has_many_through then how do i
>> create a new record?
> Start by reading the rails guide on active record relations, that shows
> you how to do that sort of thing.
This code `@person.pictures << @picture` causes an error
Could not find the association :people_pictures in model Person
class PeoplePictures < ApplicationRecord
class Person < ApplicationRecord
has_many :pictures, through: :people_pictures
class Picture < ApplicationRecord
has_many :people, through: :people_pictures
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 post to this group, send email to firstname.lastname@example.org.
To view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.