Code Monkey home page Code Monkey logo

shopping_lab's Introduction

Shopping Lab

For this lab, we'd like you to create a small application that mimics a very minialistic shopping site. The application should allow users to sign up and login and then see a list of products and create orders which are different combinations of products

Getting started

  1. Examine the code provided and take a look at the routes, migrations and controllers. Before migrating - add the following to the models:

  2. A User should have a:

    • username (this should always be unique)
    • password (this should be at least 5 characters)
    • password_digest (this is for has_secure_password)
    • is_admin (a boolean which by default is false)
  3. A Product should have a:

    • name (this should always be present)
    • category
    • price
  4. An Order should have a:

    • name (this should always be present)
  5. Start setting up your associations (a user can make many orders, many orders have many different products and many different products can belong to many different orders)

  6. Use has many through for your many to many association.

  7. Test your models, associations and validations in rails console before continuing.

Views and Controllers

  1. Start by building a simple log in system using has_secure_password and sessions.
  2. When a user logs in, if they are not an admin, they should see a list of products and have the option to create a new order and see their existing orders
  3. If the user is an admin, they should be able to perform full CRUD on the products.
  4. When a user goes to create a new order, they should see a list of all of the products and be able to add how ever many products they like to each other (use checkboxes for this - review the cookbook app to see how this was done)

BONUS

  1. Ensure that users can only see their orders unless they are an admin.
  2. Allow admin's to view a list of all of the users.
  3. Allow users to change their personal information (username and password).
  4. Show the total price of the order when a users sees their orders.
  5. Convert routes.rb to use (nested?) resources to generate the routes.

shopping_lab's People

Watchers

 avatar  avatar  avatar  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.