Sinatra Project: Now I Know This Diddy

Posted by Jonathan Baker on July 30, 2020

If you have coded with Sinatra, I would suppose you have seen the dreaded “Sinatra doesn’t know this diddy” page followed by a suggested block of code. I saw this page more often than I care to admit. This is only my second project as a Flatiron student, but it proved to be more challenging than the first.

The overall concepts within Sinatra seemed simple and straigtforward. With the help of ActiveRecord, we would be able to Create, Read, Update, and Delete objects (CRUD). We would use the second major acronym (MVC = Models, Views, Controllers) to send our requests. From the controller, we send requests to see forms or information on view pages. If we are creating or updating, we post these changes. All of this is possible because of the models we created that are inheriting from ActiveRecord.

Within this module, there were “bonus” labs on Rack, HTML, and CSS. Since I do not have a background in web dev, I found it necessary for me to complete these labs so that I could have a better understanding of the Sinatra labs. As a result, I felt like I was playing catchup the last few weeks. I didn’t feel very confident going into project weeks.

Building out the code for the app took a while. As I mentioned early, I encountered several bugs along the way that were challenging to debug. However, as I coded, I realized most of the mistakes I was making were syntax errors. Maybe I actually did understand what I was doing. More than once, I omitted a “)”, “>”, or a “=” in my code. I don’t have experience with HTML, so I felt it was best that I not use an extension in VS Code that would auto-populate syntax. In some ways, I wish I had used an extension because I would have finished my project sooner, but I’m glad that I went through the struggle of trying to figure out what was broken. I believe it gave me a better understanding of the sytax, so even when I use extensions in the future, I will be familiar with certain error messages.