On Viernes, 6 de Agosto de 2010 17:30:15 Benjamin Adler escribió:
> I'm almost done, but must have made an error when implementing my custom
> subform. When I edit a batches existing StorageAssignments,
> create-another and click on Update, it sends:
>
> Parameters: {...,
> "storage_assignments"=>{
> "118"=>{"id"=>"118", "storage"=>{"id"=>"18"}, "slot"=>{"id"=>"153"}},
> "0"=>{"storage"=>{"id"=>"18"}, "slot"=>{"id"=>"86"}}},
> ...}
>
> where the first SA (118) was previously in the database and the second
> was just added using the CreateAnother-Button and got a unique value (0).
>
> But when I clicked on edit, there was another SA with values (id:119,
> storage_id:18, slot_id:100, item_type:"Batch", item_id:3). I deleted it
> in the subform using the red cross, so its values weren't sent in the
> params-hash anymore. This seems to be normal behavior (at least the
> default AS subform seems to do the same).
>
> Unfortunately the (deleted) record with id 119 is still in the database,
> but has its attribute item_id updated from 3 to NULL.
>
> Why is that? What do I have to send in the params-hash to let the
> controller delete this SA 119?AS doesn't delete unassociated records, they are deleted if you set :dependent to :delete_all or :destroy in your association definition. > > thanks! > ben -- Sergio Cambra .:: entreCables S.L. ::. Mariana Pineda 23, 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) [email protected] -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en.
