我在 和 之间创建了一个关联customer_bill
,customer_bill_line_item
如下所示:
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
?
需要指导。提前致谢。