My Flatiron Journey: My Ruby on Rails Portfolio Project

Matthew Jones
4 min readJan 17, 2021

The Ruby on Rails project was definitely the most challenging part of my experience as a Flatiron student thus far. It pushed me in a lot of different ways and tested my discipline as a student and skill as a coder. The main challenges that manifested over the course of the weeks that I spent working on the project were keeping all of the one-to-many and many-to-many relationships organized as I developed the app and setting out Oauth to allow the user to log in through an outside source, in this case, Facebook.

First, I want to talk about the mistakes I made that allowed this project to be more challenging than it should have been. I talked about how confusing the object relationships would get, and all of that could have been solved by better project planning. When I started to work on my app, I just jumped straight into the code. I didn’t take the time to map out all of the different relationships like I should have, instead thinking “it’s not that hard, I’ll figure it out as I go.”

Needless to say, the first thing that I learned is that proper planning is essential when starting a new project, even if it seems simple at the time. Keeping your files clearly organized and properly named will go a long way toward making it easier for you to work on your code again after putting it down for a couple days, and will be the only thing that makes it possible for someone new to look at it and understand what you’re doing.

The first of my more technical problems came when I had to add the ability for the user to log in through an outside source. I chose to use Facebook as it was the one we used during one of our labs, and, as I found out later, the only one that was allowing you to publish apps during COVID-19, as many others had halted their reviews of new developer accounts. Everything went smoothly at first, setting up the omniauth initializer, modifying the sessions#create method to pull data from Facebook and save it to the instance of the User class that was created or found at login,

and adding a link to the front page that allowed a user to log in through Facebook.

The problem came, as it always does, when I tried to use it for the first time. That was when I received an error message saying that my app ID was invalid. I scoured my code multiple times, looking at the initializer to make sure that it was taking the app ID from the env, then checking my .env file to make sure that I had copied over the app ID correctly. I even checked for hidden white spaces that might be causing the error. None of it worked. That was when I learned to slow down and make sure to do things step by step. During what felt like the 50th time checking my code, I found out that I had never loaded the dotenv gem that was crucial to this part of my code functioning. By my best estimate, what Facebook was receiving as an app ID was the string “FACEBOOK_APP_KEY,” which clearly is not valid. A quick run of bundle install later, and everything was working as intended.

The biggest lessons that I took away from this project were not even related to the syntax of the code that I wrote, but rather to the way I approached the project overall. Multiple times, I found myself rushing forward and trying to do things quickly without taking the time to plot out my approach first. Every time, this just made my project confuse me more and take longer. A big part of being a competent programmer, I think, is learning to follow the process step by step. Attention to detail is key, and it’s important to make sure that you’re doing everything correctly every step of the way or else you’ll end up like me, trying to look over your entire project time and time again, unable to find the simple source of your latest bug.

--

--

Matthew Jones

Matthew Jones is a full stack developer who enjoys coding, drinking tea, and playing board games with his friends.