我正在尝试创建一个不保留到数据库但传递到第三方系统的发票系统。因此,我的模型不是 ActiveRecord,因为没有要持久化的表。如何在我的发票模型中接受发票行项目的嵌套属性?
这是我的表单中生成的参数的示例
{"payportal_invoice"=>{"invoice_lines"=>{"quantity"=>["1", "2"], "units"=>["hours", "hours"], "price"=>["10", "20"], "description"=>["desc", "d"]}, "dueDate"=>"10/10/2013", "invoiceNumber"=>"3.13.13.11:47", "description"=>"notes"}, "attachment_name"=>""}
我可以轻松地从此参数集创建发票模型,但不确定如何创建行项目