我有 3 个表 Collections、Tracks 和 ProductContributors Association 如下
class Collection < ActiveRecord::Base
has_many :product_contributors, :as => :product
has_many :tracks, :through => Product_contributors, :as=> :product
end
class Track < ActiveRecord::Base
has_many :product_contributors, :as => :product
has_many :collections, :through => Product_contributors, :as => :product
end
class ProductContributor < < ActiveRecord::Base
belongs_to :product, :polymorphic => true
belongs_to :collection
belongs_to :track
end
每当我点击产品贡献者的 url 时,我都会收到以下错误:
Expected /app/models/track.rb to define TRACK
我已经浏览了这个url,但无论如何都没有帮助我。我没有自动加载问题,我所有的模型都正确加载
任何帮助将不胜感激.. !!