vendredi 17 avril 2015

Traversing over nested parameters in rails 4

Is there a way to traverse over parameters in rails? I have a nested params:





"request"=>{"name"=>"Gianni Hayes",
"address"=>"5858 Bernhard Burgs",
"phone"=>"(972) 399-9601",
"mobile"=>"777 777 01 02",
"filled_cartridges_attributes"=>{
"0"=>{
"cartridge_id"=>"HP laserjet 300",
"_destroy"=>"false"}
},
"description"=>"sakld",
"responsible"=>"15",



There might be many "filled_cartridges_attributes, so i need to iterate through them in controller.


Aucun commentaire:

Enregistrer un commentaire