我在rails中有一个多对多的关系。所有数据库表都相应地适当命名。所有模型文件都是复数并使用下划线分隔单词。所有命名约定都遵循 ruby 和 rails 标准。我在我的模型中使用了很多,如下所示:
has_many :users, :through => :users_posts #Post model
has_many :posts, :through => :users_posts #User model
belongs_to :users #UsersSource model
belongs_to :posts #UsersSource model
这个错误还有什么可能来自?
ActiveRecord::HasManyThroughAssociationNotFoundError in UsersController#welcome
Could not find the association :users_posts in model Post