Rails: HasManyThroughAssociationNotFoundError

后端 未结 3 1854
面向向阳花
面向向阳花 2020-12-23 16:36

I have problems with getting a has_many through association to work.

I keep getting this exception:

Article.find(1).warehouses.build
Act         


        
3条回答
  •  粉色の甜心
    2020-12-23 16:52

    You need to add

    has_many :entries
    

    To each of your models, since the :through option just specifies a second association which it should use to find the other side.

提交回复
热议问题