ruby + rails project 003

Posted on Nov 4, 2019

former title: flatiron school portfolio project 003 + ruby on magic

i completed my first ever ruby on rails project - climbing_gear. that, for me, is a pretty big deal! for a long time i’ve used programming languages for scripting, adding simple functionality and building some pretty simple applications where i worked on just the frontend/backend/server. i never worked on each level of an application. so making a full stack rails application is something i’m pretty glad i got to finally do.

the application allows users to track their climbing gear. a user can sign up for an account, log in, then add personal items that are personal records of catalog items. personal items include notes, date info about a catalog item they acquired.

so my general thought process when i started planning the design of climbing_gear is as follows:

  1. user story: to have a general user story as the overarching idea of what goals you want to accomplish in using this app.
  2. migrations and models: i tried to consider what the data model should be. what are the classes or ‘models’ in ruby speak, how will they relate to each other (such as one to one, one to many, many to many). the app has three models: user, item (the catalog item), personal item (the item that’s owned by the user).
  3. use cases: i think about use cases for the app, what scenarios you need to design. so i thought about how a user might want to go in and add an item, view their personal inventory, edit and delete personal items, and view the item catalog, and what these pages might look like
  4. views: i thought about how to translate those scenarios into code. i mapped out the different url routes that i’d need, which of these routes are pages that render data, which are forms that accept data, or nested, and if conditionals are required
  5. controllers: finally i thought about how to get everything to work via controllers. how to direct and route data

i’m not sure if this is the right way to plan an application, but this is the process that made the most sense to me, and it’s the general approach i took to building it out.

it was another quick turnaround, but what a learning experience!

i learned a few things, namely that i underestimated how complex building a rails app could be. it’s deceptively simple because you if you take a look at a rails app, the code seems minimal and quite readable. many people i’ve talked about ruby on rails with calls it ‘magic’, and i see why now. the simplicity and streamlined syntax of rails means that it’s a high level of abstraction, which hides a lot of the low level complex logic that goes into constructing the app. this obfuscation means you have to do a lot of documentation reading and building up the foundational knowledge of programming to really understand the underlying complexity of what’s going on.

and with that, my todo checklist for my next project:

  • [] start early (to be more concrete, i’m going to promise to give myself 10 days head start). what we’re learning in the program is moving towards greater and greater abstraction, so i need to give myself more time to understand what’s going on. i find that coding apps is a better learning experience for me than reading and going through labs. of course you need to do both, and the structured program does have some interactivity through study groups and interactions with other people in the cohort, but i think for me nothing beats working on an app start to finish, digging through documentation and forums to work through your issues.
  • [] figure out how to host a rails app on heroku. i think this would be a good way to get a more holistic systems/full stack development perspective on how web applications run and operate, and how to maintain them
  • [] come up with some robust troubleshooting procedures. there’s so many different ways to troubleshoot, via the browser, rails console, binding.pry or other libraries, writing tests….it’s hard to sometimes know the best approach to take. but i want to get very comfortable with all of these different methods. your efficiency could exponentially increase as a result