Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 3 没有activerecord的嵌套属性_Ruby On Rails 3_Model View Controller_Nested Attributes - Fatal编程技术网

Ruby on rails 3 没有activerecord的嵌套属性

Ruby on rails 3 没有activerecord的嵌套属性,ruby-on-rails-3,model-view-controller,nested-attributes,Ruby On Rails 3,Model View Controller,Nested Attributes,我正在尝试创建一个发票系统,它不会持久保存到数据库,而是传递到第三方系统。因此,我的模型不是ActiveRecord,因为没有可持久化的表。如何接受发票模型中发票行项目的嵌套属性 这是从我的表单中得到的参数的一个示例 {"payportal_invoice"=>{"invoice_lines"=>{"quantity"=>["1", "2"], "units"=>["hours", "hours"], "price"=>["10", "20"], "descript

我正在尝试创建一个发票系统,它不会持久保存到数据库,而是传递到第三方系统。因此,我的模型不是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"=>""}

我可以很容易地从这个参数集创建发票模型,但不确定如何创建行项目

您是否尝试过使用无表gem,例如

我过去曾在类似的情况下使用过它们——您可以执行所有标准验证等,但无需调用ActiveRecord