我創建customer_bill
和customer_bill_line_item
之間的關聯如下:未初始化的常量CustomerBill :: CustomerBillLineItem
class CustomerBill < ActiveRecord::Base
attr_accessible :customer_bill_line_items_attributes
has_many :customer_bill_line_items, :dependent =>:destroy
accepts_nested_attributes_for :customer_bill_line_items, :allow_destroy => true
end
class CustomerBillLineItem < ActiveRecord::Base
attr_accessible :customer_bill_id
belongs_to :customer_bill, :foreign_key => "customer_bill_id"
end
當我進入一種形式,創建模式,我得到以下錯誤:
uninitialized constant CustomerBill::CustomerBillLineItem
Extracted source (around line #66):
63: <%end%>
64:
65:
66: <%= f.fields_for :customer_bill_line_items do |builder| %>
67: <%= render 'customer_bill_line_item_fields', :f => builder %>
68: <%end%>
的完整的堆棧跟蹤在評論中給出。
是否有一個協會,必須在customer_bills_controller
,如@customer_bill.customer_bill_line_items
?
需要指導。提前致謝。
你可以添加一個鏈接到顯示堆棧跟蹤的要點嗎? – jvnill
http://pastebin.com/NNTbFZV5: - 這是事件 – bharath
的全部痕跡,你還可以在問題和突出顯示第66行'app/views/customer_bills/_form.html.erb'上包含以下文件。 – jvnill