EnquiryForm
我和UniversityFeeInstallment
EnquiryForm has_many
UniversityFeeInstallment之间有一对多的关系。
以下是params
我从控制器收到的
{
"utf8"=>"✓",
"authenticity_token"=>"jqgiRlk606pDzMEAtS/mGoWz8T61PgyCkKdMzSHEiQA=",
"enquiry"=>{
"university_fee_installments_attributes"=>{
"1338318502006"=>{
"due_date"=>"2012-05-28",
"amount"=>"1200"
}
}
},
"commit"=>"Update Enquiry",
"id"=>"4fc3db492d6d130238000028"
}
我正在使用 Ryan Bates 经典的嵌套形式技术。型号代码也是:
has_many :development_fee_installments, :autosave => true
has_many :university_fee_installments, :autosave => true
accepts_nested_attributes_for :development_fee_installments
accepts_nested_attributes_for :university_fee_installments
控制器:
def update
@enquiry = Enauiry.find(params[:id])
if @enquiry.save
redirect_to enquiry_payments_path(@enquiry, :notice => "Installment details updated")
else
render 'edit_installments'
end
end
我无法保存 university_fee_installments。