我有以下型號Rails的主動管理多對多關係
class Owner < ActiveRecord::Base
has_many :business_owners
has_many :businesses, :through => :business_owner
end
class Business < Active Record::Base
has_many :business_owners
has_many :businesses, :through => :business_owner
end
class BusinessOwner < ActiveRecord::Base
belongs_to :owners
belongs_to :businesses
end
我已經嘗試了BusinessOwner模型添加到管理儀表板都:在應用
rails generate active_admin:resource BusinessOwner
它創建了一個文件名爲business_owners/admin/ 當我嘗試查看業主我收到以下錯誤:
uninitialized constant BusinessOwner::Owners
Extracted source (around line #1):
1: render renderer_for(:index)
有人能告訴我如何使用活動管理與多對多的關係?
您的岩石。我的不好。是的,一個或兩個測試會發現這一點。 – 2012-02-26 15:14:39