Giter VIP home page Giter VIP logo

defender-grubhub's Introduction

Defender Grubhub

Learning Goals

  • Building a full CRUD App with a single resource

Introduction

This lab will practice building out the full MVC for a CRUD app for a single resource

Setup

As with other labs in this section, there is some starter code in place. To get set up, run:

$ bundle install

You can work on this lab by running the tests with learn test. You can run the Rails server with:

$ rails s

Instructions

For all the deliverables below, if you use any Rails generators to create models controllers or views, make sure to use the --no-test-framework flag to avoid overwriting the existing tests.

Models

Create a Restaurant model with the following attributes:

  • name that is a string type
  • description that is a string type
  • city that is a string type
  • star_rating that is an integer type
  • cuisine that is a string type

Your User model should also:

  • validate the restaurant's name to ensure that it is present and unique (no two users can have the same username)
  • validate the restaurants star_rating is between 1 and 5

Run the migrations after creating your models.

Ensure that the tests for the models are passing before moving forward. To run the tests for only the model files, run:

$ rspec spec/models

Routes, Views, Controller

Next up is to set up RESTful actions for our restuarants. Build out CRUD for our Restaurant app so we can start serving delicious food! This can be test driven with the following:

$ rspec

Good luck and have fun!

defender-grubhub's People

Contributors

gillianwenhold avatar jon1735 avatar smkopp92 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.