How to do has_many with a model that is in a namespace

后端 未结 1 508
后悔当初
后悔当初 2021-02-20 04:21

Rails 3 gave us these nice generators that place models and controllers into namespaces, whoo! But now I\'m unable to associate them with other models.

I\'m trying to a

1条回答
  •  野性不改
    2021-02-20 04:38

    I have not tried using namespaces for models myself, but when specifying a class for an association, you should use :class_name instead of :class. The rest looks good to me so that might be the only thing you need to change.

    0 讨论(0)
提交回复
热议问题