DEV Community

loading...
Cover image for Project 2 Blog Post

Project 2 Blog Post

mattmrak profile image MattMrak ・2 min read
 This project was a fun one. My inspiration for this app was one of my passions; traveling. I wanted to build an app that would keep track of all the destinations I have visited, along with some cool functionality. To turn this idea into a working app, I needed to utilize Sinatra MVC.

 The first step to make this app become a reality was to be able to create a user. A user needs to have email and password credentials, with validations for each. Along with that a user needs to have a session[:user_id] set to keep track of each user and the destinations they create. After this, Models need to be set up so that a User has_many destinations and a Destination belongs_to a User. This is where the validations for a user are created. A few Controllers are needed to handle the routes for how the app runs and CRUD actions. An application_controller, a destinations_controller, a sessions_controller, and a users_controller. The CRUD actions are created in the destinations_controller. A user needs to be able to Create a new destination that will be added to their list, Read all of the destinations on their list, Update a destination from their list, and Delete a destination from their list. To help make all of that possible, Views is needed. Files in the Views directory contain forms that are executed each time the user makes a selection on their browser. This is also where we can do some CSS styling. 

 CSS styling is something I get lost in for hours. There are so man possibilities for what you can do. You can fully customize your web app to your liking - from the text font/color to a navigation bar. "https://www.w3schools.com/css/default.asp" helped me out a lot with my CSS styling. There is so much useful information, and good examples of how to put CSS styling into your code.
Enter fullscreen mode Exit fullscreen mode

Discussion (0)

pic
Editor guide