Rails moving data from one db table to another and adding new record or add to an existing record

110 views Asked by At

I am creating an app that allows the user to enter and store recipes. They can also create a grocery list. So I have a table that stores the recipes and a table that stores the grocery lists. When they are viewing the recipe, there will be button that says "Add to Grocery List". When that button is clicked, I want a window to come up that says "Add to Existing Grocery List" with a drop down of the current grocery lists that are stored or "Create a New Grocery List", which will lead to the page where you create a grocery list. I also need the list of ingredients to be automatically passed to the grocery list.

I'm not sure how to pass the data from one table to another or how to give the user the option to select an existing grocery list. Does anyone have any idea of how to do this?

0

There are 0 answers