Coder Social home page Coder Social logo

brew-crew's Introduction

README

Objectives

  • Make associations for multiple models
  • ActiveRecord
  • form_for / form_tag / form_helpers

The Domain

You've been hired as a barista at a cafe and want to improve their point of sales system! You see so many customers throughout the day, but want to know which customers are regulars, and track their purchases.

  • A customer has_many purchases
  • A brew has_many purchases
  • A purchase belongs_to a customer and to a brew
  • A customer has_many brews through purchases
  • A brew has_many customers through purchases

Already Completed

  • rails new brew-crew
  • rails g model Brew blend_name:string origin:string notes:string strength:integer
  • added 'faker' gem to Gemfile
  • rails g model Customer name
  • rails g model Purchase brew_id:integer customer_id:integer
  • Created seed data

Setup

  • Fork and clone the repo
  • In terminal, run bundle install
  • In terminal, run rake db:migrate
Deliverables
  • Create the associations between the models, then run rake db:seed, check that Brews have been made in the rails console
  • As the user, when I go to the brews index page, it should display all of the brews as links to their show page.
  • As the user, the brew show page should have the brews name, origin, notes, and strength
  • As the user, the customer show page should display their name and list all of the brews they've purchased
  • As the user, I should be able to create a new purchase (with a collection_select for Brew.all) and a field for a customer's name (how would I be able to take in a new Customer if I wasn't already found?)

Bonus

  • Create a validation so a Customer's name must be unique
  • Create a new page for creating a brew and give it a form for all the fields necessary for a brew
  • Create validations so the fields cannot be empty
  • Create validations so that the strength of a brew must be between 1 to 5

brew-crew's People

Contributors

aalexander3 avatar maxcell avatar perpepajn25 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.