Wish List Sinatra Project
As part of my Flatiron Learn Verified program my second project was building a MVC Sinatra Project.
What is it?
The Web Application I built was A Wish List were you create a user account and user can create many wish lists and these list can have many items.
The homepage is pretty static page with just two buttons which lead to a sign up and sign in page.
I used a layout page which would yield to the other views. The layout file contained navbar and basic style so I would not have to implement this into every view file.
I used Sessions to set user.id to sessions id. I used this to check throughout the site if the current user is authorized to create or destroy what they are trying to.I created two helper methods do I would not have to keep repeating this could throughout.
The logged_in? method returns a boolean depending if a user is logged in and the current_user method finds current user through current session value.
For your eyes only
If a user is logged in and that wish list is theirs they should be able to modify it.
If the current user did not create the wishlist or no one is logged in they should not be able to even view these options.
The way in which I accomplished this putting a if statement in the view file of the wishlist show page using embedded ruby. The code checks if a user is logged in and if a user is logged in it checks to see if they are the one who created this wish list.
I fill like i gained a lot of knowledge developing this Sinatra project and it helped to engrain the things which I was learning. Having this be my first real web application even though something small it feels really good to create something and I look forward to creating much more.
https://wish-list-sinatra.herokuapp.com — Live App
https://youtu.be/SPe73MuzhkY — Video walkthrough