NitBravoA92 / recipe-app

The RecipeApp is a web application build on Ruby on Rails and TailwindCSS that allows you to save ingredients, keep track of what you have, create recipes, and generate a shopping list based on what you have and what you are missing from a recipe.
https://recipe-app-zxdn.onrender.com/
MIT License
8 stars 1 forks source link

Public recipes page #25

Closed Luffytaro22 closed 1 year ago

Luffytaro22 commented 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.