hgreene — 2013-04-12T16:51:20-04:00 — #1
I'm thinking of adding check boxes beside the list of ingredients to the recipe they are looking at.
Don't know if I've attached a screenshot properly or not, but this is an example of a recipe currently. I want to utilize a check box, so that if I need that particular ingredient I will select it. Then when I'm done reviewing the recipe, I can click on a button that will say something like Add ingredients to my Grocery list. It will take the checked items and put them on a new page... or save the list to the DB (I'm not sure which would be the best choice here). I want the user to be able to go look at as many recipes as they wish and keep adding to their list and then allow them to print. Should I take the checked items and create a new table to store the data until they are ready to print, or could I keep adding to an open page, so I don't have to create anything new in my DB.
I can do either (I think), I just want to do it the best way the first time.
starlion — 2013-04-12T21:35:33-04:00 — #2
Sessions would persist as long as the person doesnt break the session (spend too much time between pageloads, or close the browser).
A database solution would be a bit more intensive on server operation, but would be a more lasting solution if you foresee that being an issue.
If using the database, it would (depending on your construction) be a join table between ingredients and user, probably with a quantity count (so that you can have more than one of the same ingredient.)
hgreene — 2013-04-12T22:15:18-04:00 — #3
Great! I have a session for each user, so I will begin building on the session and do some testing. I might be posting again since it's been three years since I've done any coding.