Re: Multiple child models in a dynamic form
Hi, thanks for the tutorial!
I do have a question though, How would you do it to, for example, sum fields in an estimate, I'm guessing with observe_field, but I not sure how to implement it because of the ids of each child.
Example, you have an estimate and this has many products (product name, unit cost, quantity, etc), that you can add dynamically to the estimate, just like your tutorial.
So, my question is how would you do it to show the total(rjs?) of each product ( product_unit_cost x product_quantity = product_total) in the same row(just view)
and also how to show the estimate's total ( product_1_total + product_2_total + ...).
Other question, when the user save the estimate, sometimes they left empty products(child) but they are saved in the db anyway, how can I do it to not save the empty childs?.
Thanks in advance.
Last edited by johnT (2009-05-12 20:01:45)