Closed Luffytaro22 closed 1 year ago
Public Recipes Page 👍 Added routes for the /public_recipes path. Create a RecipeFoods controller with the logic to retrieve all the public recipes ordered by newest in the ìndex action. Add has_many :recipe_foods in the food and recipe models. In the recipe model created a total_price method to calculate the total price of ingredients in each recipe. In the recipe food model created a increment_quantity method to update the number of ingredients in a recipe. Created a migration to change the quantity datatype in the recipe_foods table.
routes
/public_recipes
RecipeFoods controller
public recipes
ìndex
has_many :recipe_foods
food
recipe
models
recipe model
total_price
price
ingredients
recipe food model
increment_quantity
number
migration
quantity datatype
recipe_foods