layout |
---|
page |
In this project you'll use Ruby, Sinatra, and Activerecord to build a site that shows items by categories and analyzes those items.
- Use ActiveRecord migrations to create a normalized database.
- Utilize ActiveRecord methods and relationships to efficiently query the database.
- Use beginner/intermediate ActiveRecord queries to calculate and report on information in the database.
- Use Sinatra and ERB templates to render views to create, read, update, and delete resources using RESTful routes and appropriate HTTP verbs.
- Use Sinatra and ERB templates to display a dashboard not related to a specific resource saved in the database.
- Use HTML and CSS to create a user experience that allows users to comfortably navigate a site.
- Organize code using best practices (use POROs when appropriate, avoid long methods, etc.).
- Create methods using ActiveRecord on the appropriate class.
- No logic should live in the views.
- Use RSpec to drive development at the feature and model levels.
- Use Git Merge Workflow and GitHub to work collaboratively, develop in smaller groups, and resolve merge conflicts
DTR with your group here. One group member should send a link of the forked gist to your anchor as soon as it's complete.
- One team member forks this skeleton repository.
- Add the other team members as collaborators.
- Add instructors as collaborators.
This project must use:
This base repo has already configured those three for you.
You'll want to set up the DatabaseCleaner gem in order to have a clean database each time you run tests. Follow the instructions for setting up the gem. Due to a bug in the most recent version of the gem, you'll need to use this line when you set the strategy in your test helper file:
DatabaseCleaner.strategy = :truncation
See the "Resources" section at the bottom of this page for additional helpful documentation.
The project may not use:
Rails
Iterations 0-9 must be completed in order to consider the project complete. Please TDD throughout. Tests are expected for all features and all models.
Create full CRUD functionality for a merchant with the following characteristics:
- name - must be present
Once you have the Merchant
model started, finish it off by creating validations for the Merchant
attributes.
You can use ActiveRecord's validations feature to make sure no record is saved without having all attributes present.
Be sure to have a test for each individual validation.
At the end of this iteration, you should be able to view an index of all merchants, view a page for a single merchant, create a merchant, edit a merchant, and delete a merchant from either the index or the show pages
Update the seeds
file in your /db directory to parse the merchants.csv
. When you run rake db:seed your development database should be populated with the information from the merchants.csv file. Your index should include a total of 475 merchants.
Create full CRUD functionality for a category with the following characteristics:
- name - must be present
Once you have the Category
model started, finish it off by creating validations for the Category
attributes.
You can use ActiveRecord's validations feature to make sure no record is saved without having all attributes present.
Be sure to have a test for each individual validation.
At the end of this iteration, you should be able to view an index of all categories, view a page for a single category, create a category, edit a category, and delete a category from either the index or the show pages.
Create a CSV file for categories.csv
. This file should have at least 3 categories in it. Use categories.csv
to seed categories. Be sure to not duplicate data when seeding.
Create full CRUD functionality for an item with the following characteristics:
- title
- description
- price
- image
Once you have the Item
model started, finish it off by creating validations for the Item
attributes.
- All the attributes must be present.
You can use ActiveRecord's validations feature to make sure no record is saved without having all attributes present.
Be sure to have a test for each individual validation.
At the end of this iteration, you should be able to view an index of all items, view a page for a single item, create an item, edit an item, and delete an item from either the index or the show pages.
- When creating an item, there should be a dropdown of all merchants and a dropdown of all categories to select from.
Update the seeds
file in your /db directory to parse the items.csv
. When you run rake db:seed your development database should be populated with the information from the items.csv file. Be sure to not duplicate data when seeding.
Create an item dashboard route. When you visit /items-dashboard
you should be shown a page with the following information:
- Total count of items
- Average price per item.
- Most recently created item.
- Oldest item.
Create a categories dashboard route. When you visit /categories-dashboard
users should be shown a page with the following information:
- Average price of item breakdown by each category.
- Category with most expensive item.
- Category with least expensive item.
Create a merchants dashboard route. When you visit /merchants-dashboard
users should be shown a page with the following information:
- Merchant with the most items and that merchant's information.
- Merchant with the highest priced item and that merchant's information.
- Breakdown of each merchant with total number of items and total price for all items.
- Use Google Charts to display information on one or more of your dashboards.
- Read about JSON. Create an endpoint at
api/v1/items/:id
that responds to requests with JSON instead of HTML. - Deploy your application to Heroku