Running the Terminal Store
Collapse Content
Show Content
The basic terminal store is now set up! Your store administrator could use it for basic CRUD commands to track his inventory and let customers know what's available. He can access specific products by id, or pull up available products, sold out products, or products in one category.
Practice
Fire up your Rails console and run the following commands.
- Your store just got its first delivery of Cornflakes! There are 10 boxes of cornflakes available for sale.
Create a new product called "Cornflakes" in the food category. Give it an appropriate description and quantity. - A customer came in and buys cornflakes. Run the query to track this.
- Another customer would like to know what machines you have for sale. Can you run a query for this?
In the next tutorials, we'll see how to build this into a complete web application...
Challenge
Run rake test
in your terminal.
Please sign in or sign up to submit answers.
Alternatively, you can try out Learneroo before signing up.