“Who you checking for?!” A story about Sinatra & Day Names.

Nana Ama Siriboe
2 min readApr 28, 2021
Photo by Roman Synkevych on Unsplash

Well, it’s the end of Phase 2 and we’ve entered into Project week! For my Sinatra Project, I decided to use a part of my culture as inspiration for my project build and I called it “The Day Name Generator”. Being Ghanaian, it’s customary for all newborns to be given a distinct name that correlates to the day of the week that they were born. For the flow of my project, I decided to build out my MVC framework around the fact that a user can pick the day name that correlates with the day they were born and add a description to their name profile. A user can also add names to their profile and see other users’ names.

One of the things that was the most essential in building out my project was using the corneal gem. The corneal gem allowed me to have my MVC (Model-View-Controller) framework built out to easily start expanding the other aspects of my project. Using ActiveRecord to set up my databases for my app, I was able to create migrations and link them to the various pages I created for the “Views” section of my project build.

My views files were all written in “erb” in order to hold my HTML text in order to be rendered on all my webpages. ERB, or “Embedded RuBy is a feature in Ruby that allows a developer to generate any kind of text, in any quantity, from various templates. Due to this, I was able to interpolate various ruby methods into my HTML text allow it show or not show on the page using certain tags called “erb tags”. Similar to html tags, erb tags open and close, but are classified by the percent symbol (%) located at the end of the tag.

Having an MVC framework in Sinatra allowed me to understand the importance of having various components of an application being separate and joined together by how each component interacts with each other as well as the user when the info is shown to them in browser. I’m excited to see how certain aspects in Sinatra translate to what we’ll learn in our next phase.

--

--

Nana Ama Siriboe
0 Followers

A black girl, making her own way in the tech space