GithubHelp home page GithubHelp logo

flatiron-store-project-v-000's Introduction

Flatiron Store on Rails

DEPRECATED: This lesson does not meet our standards and will be removed in a future release

Overview

We're going to build an e-commerce site! We're going to make an online store where users can browse items, put items in their carts, and buy items, which changes our inventory.

Instructions

Users

  1. Have just an email and password
  2. Should be able to log in and log out
  3. Also sign up
  4. Note: You must use the Devise gem to set up user for tests to pass.
  5. You may find that you're missing some seed data. Look at the error messages you get carefully and don't be surprised if you have to add some seed data

Items

  1. List of available items whether you are logged in or not
  2. If logged in, each item should have an "Add to Cart" button
  3. When the user adds an item to the cart it should show them their current cart

Cart/Checkout

  1. Users should be able to checkout from their cart
  2. This shows them their cart afterwards, and deducts inventory from each item
  3. Prices should be in the $XX.XX format
  4. The Checkout process should set that current cart to a status of "submitted"

Headers/Nav

  1. Users should know who they are logged in as
  2. Users should be able to sign in/out from the navigation bar
  3. Users should always be able to go "home"
  4. If the user has a current cart, there should be a "Cart" link to their current cart

Specifying custom class names and foreign keys

Imagine a simple dating app that tracks relationships between its users. In order to retrieve a user's current relationship from the database, it would make sense to call something like user.current_relationship. However, Active Record doesn't intuitively understand that it should map the belongs_to :current_relationship association to the Relationship model (or the corresponding relationship_id column in the database). To explicitly point it at the correct model, we can use the :class_name and :foreign_key attributes like so:

class User < ActiveRecord::Base
  belongs_to :current_relationship, class_name: 'Relationship', foreign_key: 'relationship_id'
end

For more information, check out :class_name and :foreign_key in the RailsGuides entry on Active Record Associations, this StackOverflow post, and the models/post.rb section in this SitePoint refresher.

Resources

View Flatiron Store Project on Learn.co and start learning to code for free.

flatiron-store-project-v-000's People

Contributors

ahimmelstoss avatar annjohn avatar aturkewi avatar danielseehausen avatar deniznida avatar drakeltheryuujin avatar fislabstest avatar fs-lms-test-bot avatar gj avatar irmiller22 avatar kthffmn avatar kwebster2 avatar maxwellbenton avatar peterbell avatar pletcher avatar rrcobb avatar sarogers avatar zacscodingclub avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flatiron-store-project-v-000's Issues

Orders

There are no specs for orders in the master, the only place I see referring to an order is in the solution-fix branch. Should the order spec be in master?

Adding a line item to a cart?

If a LineItem is an Item that has been placed in a Cart, why are we calling LineItem to place itself in a Cart? 1) An Item is not a LineItem until it is in a cart, 2) why should LineItem know about Cart and 3) why would a LineItem know it needs to create a Cart if one does not exist. There already exists a method in Cart called add_item which adds an item to a cart. That seems more appropriate.

Airbrake gem breaks tests

The Airbrake gem requires an API key and registered product to run.

Removing the gem allows the tests to run as expected.

Capybara-webkit fails to install in ubuntu

I had some issues trying to run bundle install after forking and cloning this repo. I'm working on cloud9 (ubuntu) and ended up finding this post on stack overflow to solve it:

After running these commands I was able to complete bundle install:
sudo apt-get update
sudo apt-get install mesa-common-dev
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
sudo apt-get install libqt4-dev libqtwebkit-dev build-essential

Necessary to create a user for the models spec to work

Maybe not an issue, but it is a little confusing (despite the reference in the directions) to have to create a user manually for the models spec to work. I'm also not clear on the whether the spec would have access to a user created in the console or even through the sign_up page of the site, or whether, to be available to the specs, the user must be created in seeds.rb or in the test specs directly.

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.