これらは私のモデルです:
class Company < ActiveRecord::Base
has_many :products
end
class Product < ActiveRecord::Base
belongs_to :company
has_many :prices
end
class Price < ActiveRecord::Base
belongs_to :product
end
ルートでネストされたリソースとして定義しました
resources :companies
namespace :company do
scope ":company_id" do
resources :products do
resources :prices
resources :production_capabilities
end
end
end
その構造に一致するカタログにコントローラーとビューを配置したかった
app/controllers/companies_controller.rb
app/controllers/company/products_controller.rb
app/controllers/company/product
app/controllers/company/product/prices_controller.rb
社内に製品ディレクトリを作成し、電話をかけようとするとすぐに
Company.find(1).products
私は得る
NoMethodError: undefined method 'quoted_table_name' for Company::Product:Module
誰かが私が間違っていることを知っていますか?