WARNING: Can't mass-assign these protected attributes when passing xml using cURL

yunuso

New Member
I'm using rails 2.3.5, ruby 1.9.3, rubygems 1.8.24 and mac os x lionI'm passing this file, "invoice.xml.erb" using cURL:\[code\]<invoice>....<invoice_detail>....</invoice_detail></invoice>\[/code\]i was expecting to have the fields of invoice be filled and also the fields of invoice_details, but when I pass the cURL command, only the invoice fields are being filled, and this error occurs: WARNING: Can't mass-assign these protected attributes: inventoryDocId, invoice_detailhere are my models:invoice.rb\[code\]class Invoice < ActiveRecord::Baseset_table_name "inventoryDocHeader"set_primary_key "inventoryDocId"has_many :invoice_detail, :foreign_key => "inventoryDocId"attr_accessible :inventoryDocId, :originDocId, :siteCode, :transCode, :typeCode, :docCode, :partyTerms,:locationCode, :otherCharges, :grossPrice, :netPrice, :amountPaid, :amountPending, :amountReturned, :RSiteCode, :RInventoryDocId, :RDocCode, :ROriginDocId, :batchCode, :partyCharges, :partyShipmentTermsText, :estimateVolume, :originCountryId, :consigneeName, :consigneeAddress1, :consigneeAddress2, :consigneeAddress3, :notifyPartyName, :notifyPartyAddress1, :notifyPartyAddress2, :notifyPartyAddress3 end\[/code\]invoice_detail.rb\[code\]class InvoiceDetail < ActiveRecord::Baseset_table_name "inventoryDocDetail"belongs_to :invoice, :foreign_key => "inventoryDocId"attr_accessible :inventoryDocId, :lineNumber, :parentLineNumber, :productCode, :actualQuantity, :unitCode, :contentQuantity, :cost, :price, :commission, :factorRate, :referenceLineNumberend\[/code\]Any suggestions are welcome. Thank you!
 
Back
Top