我创建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