Sinatra Final

Dexter Crockett
2 min readApr 12, 2021

Well, here we are. My second project for Flatiron. This one was easier and more difficult at the same time than my first ruby gem.

Our second project consisted of making a website that included a database to hold users and their created objects. Unlike my first project, I wanted to make this one as simple and straightforward as possible. That started with choosing a simple application design. It took a while, but then it hit me. A cannabis patient journal for logging different strains one has used. It seemed perfect.

The beginning was simple enough. I hand wrote out what exactly I wanted my app to do. A user will be able to sign up and create new entries for strains they have tried. They can look at all entries, edit, and delete them as well. First I mapped out my database and migrations. It has a user migration and a strain migration. The user can log things like the name of the strain, the date they tried it, the form they tried it, THC, CBD, and leave a nice review for it. The videos that Dj provided once again helped tremendously. After that, setting up my Models and relationships was easy. A user has many strains and a strain belongs to a user.

Next came time to see if I could actually make a new user and log in. Making a new user was no problem. The trouble came when I was trying to log in. For some reason, the page just kept refreshing and not redirecting me. Of course, I was missing a simple piece of code in my users_controller. If it’s one thing I’ve learned from coding so far, it is how easy it is to overlook something. I did that a lot in this project and my last and I’m sure I will continue to do so. Finally, that was fixed and it was time to bang out some forms.

Now came the tricky part. Setting up my views and routes. This was by far the most time-consuming. I will say, I like the repetitiveness of Sinatra a little, but as I said, time-consuming. Things are more structured and easy to follow than with ruby, but it was still hard. Going back and forth between my app and my code and seeing all of the route errors was a headache, but I eventually made it through with the help of my awesome classmates and Dj’s videos again. After many hours and re-watching videos and asking for help, my journal was complete. I’m really proud of myself for my app and how it turned out. Hopefully, I can style it a little more in the future when I learn more about HTML and CSS.

--

--