Improved Playlister with Quick Superior Code

Got a large lab done tonight. Right on schedule. I was done 2 minutes after 11pm. I basically took the Music Library CLI app that I made earlier in the curriculum and turned it into a much more user-friendly Sinatra MVC web app. The final code can be found here. The biggest challenge I had was setting up my databases and models. Actually, just with the JOIN table. However, I know the more I do this the easier it will get. It’s still very new and a complex thing to grasp.

I also attended a study group this afternoon and saw another student’s Sinatra portfolio project he was working on. After quickly glancing at the project info, this line gave me an idea for my project:

The app should be a custom app that is created to track something important to you.

Since my family just moved into a new neighborhood in January I’ve been keeping track of who our neighbors are in an EverNote Doc. Pretty much, address, the matriarch, patriarch and kids with ages. I figured I could have 3 tables in this app. One for the House with an address. Then the House has_many Parents and has_many Kids through Parents. Parents with Name and Phone Number values. Parents will belongs_to a House and has_many Kids. Kids will have a name, age, and sex fields (for those unisex names). Kids will has_many Parents and belongs_to a House through Parents. I told my instructor this briefly during the study group and he said that was more than enough to fulfill the requirements of the project. All the project requires is a single has_many relationship in terms of the database aspect.

I also asked about if there was a preference between Active Record Validations or HTML5 Form Validations. He said HTML5 form validations were further in the curriculum so most would not be using them at this point in time. However, it’s just use case choice. Of course, HTML5 form validations won’t hit the DB so there’s that as well he said. I didn’t realize how complex HTML5 form validation was until I looked it up (see the link at the beginning of this paragraph) and now I realize why it isn’t taught until later. I was thinking of simple input constraints like those found here. Now there are some things that must hit the server to validate. For example, if you wanted to ensure an email address hadn’t been registered already there is only one way to check that. This is where something like Active Record’s uniqueness helper comes into play. I’m not sure how far down this rabbit hole I’ll go building out my project. Maybe just a simple <type="tel"> in what I was thinking of above. Although, since this is a portfolio project I’ll make sure to keep a set of features I want to implement to improve the app. I’ll make sure to work on getting these things done when the job hunt starts. Currently, the goal is to get to that point as quickly as possible so I’m completing projects with close to the bare minimum requirements.

Time spent today: 3:16
Time spent total: 175:09
Lessons completed today: 1
Lessons completed total: 401