我在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
Run Code Online (Sandbox Code Playgroud)
这个错误还有什么呢?
ActiveRecord::HasManyThroughAssociationNotFoundError in UsersController#welcome
Could not find the association :users_posts in model Post
activerecord many-to-many ruby-on-rails associations has-many-through