search for: ingredient_

Displaying 1 result from an estimated 1 matches for "ingredient_".

Did you mean: ingredients
2006 Jan 30
6
Looking for better code
...binds the previous 2 tables together Now, I want to have an input form where you can insert 1 recipe and a certain amount of ingredients, say 5. What do I do now: I put in my _form.rhtml-file a while loop, which generates 5 text_fields for the ingredients and i give them each a name like "ingredient_" + i.to_s Then i can read them out in my create definition in my controller by doing: params["ingredient_" + i.to_s] Ok, first I don''t like this kind code, its way to complicated, and I''m also running into problems if I want to edit a recipe... I hope someone k...