Skip to content

Instantly share code, notes, and snippets.

@Epigene
Created April 4, 2017 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Epigene/d64d29ad362d768a71859c109dac4811 to your computer and use it in GitHub Desktop.
Save Epigene/d64d29ad362d768a71859c109dac4811 to your computer and use it in GitHub Desktop.
Param structure when submitting OfferItem nested attributes for PurchaseOffer-s.
[1] pry(#<#<Class:0x007fa02286da98>>)> params
=> {"purchase_offer"=>
{"title"=>"New Title",
"offer_items_attributes"=>
[{"id"=>"364", "main"=>"0"},
{"id"=>"365", "_destroy"=>"1"},
{"purchase_item_id"=>"19", "main"=>"0"}]},
"id"=>"238",
"controller"=>"admin/purchase_offers",
"action"=>"update"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment