Hi all,
I am quite new to Ruby on Rails and what to make sure I set of on the right foot. I want to do some simple "Live Calculations" and am not sure of the best method. If we use the cookbook example.
Each Recipe has many ingredients. Each ingredient has a description, qty, cost and a total.
What I want to do is the following; 1) ingredient.total = ingredient.qty x ingredient.cost 2) recipe.grand_total = ingredients.sum(total)
Each time the user changes the values in ingredient.qty or ingredient.cost I want to update the totals.
What i don't know is how or where to do this :(
Any help would be great :)
Thanks in Advance, Neil