Skip to content

A artist supply tracking app built using Sinatra. Makes use of login, logout, activerecord associations and session.

License

Notifications You must be signed in to change notification settings

bebofofum/artist_supplies_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Name:

The Art Bin

Project Description:

A simple art supply content manager. Art Items can be added, and a list neatly displayed of all your art supplies. The item's details can be viewed with an editable description of what the item is or deleted entirely depending on whether or not the item has been used up.

Project Install Instructions:

  1. Clone the repo.
  2. In terminal, type cd 'art_supplies_app'
  3. Run 'bundle install' to ensure all dependencies are installed.
  4. Generate a new SESSION_SECRET by running 'generate_secret' in Terminal.
  5. Copy the output and paste it into the .env file after the '='
  6. Run 'rake db:migrate' in Terminal to run migrations for creating the User and ArtItem database tables.
  7. Run 'Shotgun' in Terminal to start the server.
  8. In your browser open a new window and enter 'localhost:' followed by the server address shown by Shotgun, the last 4 digits after the colon. (For example 'Listening on 127.0.0.1:9393' would use 9393, as in localhost:9393)

Project Contributors: The Art Bin

Project License: The Art Bin

MIT License

Specifications for the Sinatra Assessment

Specs:

[X] Use Sinatra to build the app. (Established sinatra gem dependency in Gemfile and assigned Sinatra environment in environment file. Built app using routes and views.) [X] Use ActiveRecord for storing information in a database. (Used an MVC model to control data flow and allocate responsibility. Established activerecord in Gemfile. Migrated table creation with ActiveRecord and Rake.) [X] Include more than one model class (e.g. User, Post, Category). (Used a User and a ArtItem model class) [X] Include at least one has_many relationship on your User model (e.g. User has_many Posts) (User has_many ArtItems) [X] Include at least one belongs_to relationship on another model (e.g. Post belongs_to User) (ArtItems belong_to User) [X] Include user accounts with unique login attribute (username or email) (User model validates to have a username and email and checks if email is unique) [X] Ensure that the belongs_to resource has routes for Creating, Reading, Updating and Destroying (ArtItem Controller has: --get '/artitems/new' to render form for User to CREATE an new artitem. --post '/artitems' do to receive the params from the form, builds an instance of the ArtItem, validates that the user has permission to create the instance by first checking if they are logged in and comparing their user id to the ArtItem object's author_id then saves the object thus CREATE. --get '/artitems/:id' to READ from the ArtItem collection and show objects based on found id params. --get '/artitems/:id/edit' and --patch "/artitems/:id" to render edit form and UPDATE the object using a method override, persisting the updated object back to the database. --delete "/artitems/:id" to DESTROY found object. Destroy is done through a submit form using a method override.

[X] Ensure that users can't modify content created by other users. (Users can't directly see other User content plus validation checks are setup to compare the current_user id against the ArtItem object's author_id.) [X] Include user input validations. User model validates for email uniquenss and the form also validates that the fields are not left empty when trying to submit the form. BONUS - not required - Display validation failures to user with error message (example form URL e.g. /posts/new) [X] Your README.md includes a short description, install instructions, a contributors guide and a link to the license for your code

Confirm

[X] You have a large number of small Git commits [X] Your commit messages are meaningful [X] You made the changes in a commit that relate to the commit message [X] You don't include changes in a commit that aren't related to the commit message

About

A artist supply tracking app built using Sinatra. Makes use of login, logout, activerecord associations and session.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published