Skip to content

Instantly share code, notes, and snippets.

@BrianZanti
Last active February 26, 2021 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrianZanti/8544465bc71a915baccc3440887e3498 to your computer and use it in GitHub Desktop.
Save BrianZanti/8544465bc71a915baccc3440887e3498 to your computer and use it in GitHub Desktop.

Overview

Order up is an app that tracks chefs, the dishes that they make, and the ingredients that are in those dishes. Chef's have many dishes. Dishes belong to a chef. Dishes have many Ingredients and Ingredients have many dishes. Ingredients should have a name and calories.

Two migrations have been made for you. The one to many relationship has been set up. You will need to create migrations for the many to many relationship between ingredients and dishes. You do not need to do model testing for validations, just make sure you test any relationships and model methods that you create.

(Note: The plural of dish is dishes. The plural of chef is chefs.)

Instructions

  • Work on this challenge independently.
  • Complete the stories below
  • Commit Frequently
  • Push your code to your fork once the time is up (not before!)

User Stories

Story 1 - Dish Show Page

As a visitor
When I visit a dish's show page
I see the dish’s name and description
And I see a list of ingredients for that dish
And I see the chef's name
Abd I see the total calorie count for that dish.
Story 2 - Chef Show Page

As a visitor
When I visit a chef's show page
I see the name of that chef
And I see a link to view a list of all ingredients that this chef uses in their dishes
When I click on that link
I'm taken to a chef's ingredient index page
and I can see a unique list of names of all the ingredients that this chef uses
Story 3 - Remove an Ingredient from a Dish

As a visitor
When I visit a dish's show page
Next to each ingredient I see a button to remove the ingredient
When I click the button
I am redirected back to the dish's show page
And I no longer see the ingredient listed for this dish

(Note: you should not delete the ingredient record entirely)

Extensions

Extension
As a visitor
When I visit a chef's show page
I see the three most popular ingredients that the chef uses in their dishes
(Popularity is based off of how many dishes use that ingredient)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment