Sinatra Video Game Library

I really enjoyed this project. The way web pages are routed and how information is persisted in databases has always fascinated me. After gathering as much information as I could I started trying to build my app. It is a video game library where users can enter in a title and genre of video game and keep them stored in a database. It is editable and you are even able to delete entries.

I watched a lot of videos and and googled lot of information on how to get started, but ultimately I just did what came easiest. I started out by creating my models; there are two. Users have many games and Games belong to users. Once I had my models and built my database. From there things progressed naturally. I built my controllers and then views.

I’m pretty happy with how the project turned out. I would like to refine it and make it filterable. It could use some CSS to format it and make it look nicer. Perhaps even allow users to upload images.

CLI Gem Project

Going in to this project I was was uneasy about how to structure the gem. From the very basics. What folders/files did I need? What would I name them? How would I get this thing to actually work? I met with my advisor. She told me to take things one step at a time. Read all that I could about building a gem and where to start. Web searches would be my best friend. I watched the walkthrough video where Avi did a fantastic job of making it easy to follow his thought process and gave excellent pointers. I was starting to feel confident that I could do this.

After learning how to bundle a gem and get all of the basic necessities in order my mind was at ease. I simply just started. When something broke (which was immediately) a copy/paste in to google was all I needed to get me going on the right track. If I got stuck somewhere I would cue up the Avi walkthrough video and think about the code I wish I had. There was a ton of trial and error. After 1 very long night I had my code working basically how I wanted it. I just wasn’t using live data scraped from a website.

I met with my advisor once again and showed her where I was stuck. She gave me some pointers and showed me a few commands that improved my code drastically. I was finally ready to scrape live data. I implemented the new code and ran my gem aaaaaaaannnndd it broke. A few google searches and some refactoring and I was back in business. I was finally scraping live data and having it display how I envisioned all along.

Some of my code is easy for me to understand. Other parts of it work, but I’m not sure why. I’m sure that if a real Ruby pro were to look at the source code they could tear it apart and refactor it to make it much more DRY. I learned a lot through this project, probably most importantly was to start coding small. Don’t think of the whole project. Start at the very beginning and write code for little portion. Break things and fix them again. I had a great time coding this project and can’t wait to get in to the next section.

Design a site like this with WordPress.com
Get started