Riding Rails

Jasmine Ryon
4 min readAug 3, 2021

My part-time cohort is a little over halfway done with the program thus far and we have reached Ruby on Rails. Rails lets us build dynamic websites in a easier way using “ruby magic,” which has built in logic and methods behind it so a developer can focus more on the usage of the website rather than the little steps needed in-between to get it working. I agree with others on the fact that using Rails has been the most fun to build thus far and its easier to add in more user capabilities; however, it’s only fun when you understand what is happening in the background to make it work, aka the “magic.” It’s also important to fully comprehend the structure needed to make a Rails application work properly; fortunately, Rails gives us very descriptive error messages to help us problem solve. With two more phases left to go, I definitely feel accomplished that I have gotten this far in the program and I’m motivated to keep the ball rolling. This phase has been the hardest only because Rails gives us so many options to play around with and methods that are included that it almost feels like the project could never be finished; I’m guessing that’s what artists feel like at times. It was very satisfying when I did get in the zone of coding and decide to add more routes and actions to my controllers that I was able to see work successfully after I debugged them; almost like a mini addiction to keep expanding the application.

When I first started brainstorming, I had no idea what I wanted my three models to be, especially knowing that I needed a join table between the two with a user submitted attribute. I eventually decided that I wanted to try and replicate a pizza ordering app because that has been pretty realistic in people’s lives lately. Restaurants and grocery stores that didn’t have an online ordering application before COVID-19 eventually got one to help stay in business. I named my application MOD Olo (stands for Online Ordering) and chose it because my wife and I both worked at MOD Pizza (thats how we met) so I thought it would be worth a shot to replicate my own version of it while fulfilling the project requirements.

I knew brainstorming for this project was going to be much harder than the previous two, so I decided to write all my thought processes and capabilities that a user can have on a google doc; I even went as far as writing the beginning steps on how to start the project from scratch so I wouldn’t get stuck on the initial setup of the project. I wanted the user experience to be normal to what we are all used to when using ordering applications for the most part.

Schema

A user can signup for an account, login, and logout. A user can also login through their Google account. Once a user signed up or logged in, that user can create a new order with preexisting pizzas and sizes or create their own pizza for that order. A user can also edit or delete their order. The Order model is the join table between a Pizza and a User. Since I had extra time, I also wanted to be able to use my User model in a different association, so I made a Review model that belongs_to a Reviewer, the alias of the User model. On the other hand, a Reviewer (User) has_many reviews and has_many reviewed pizzas through reviews. A user can also see a list of all created pizzas, write a review on a specific pizza, view all reviews of a specific pizza, order that specific pizza through a link on the pizza list page, view all the orders of a specific pizza, see their own profile once logged in of all their orders, reviews, and they can even edit their login credentials as well as delete their account. I also created a search bar on the page that lists all orders by most recent that allows a user to search by the User’s last name. On the pizzas list page, that is listed by order of creation, a user can search by pizza name too so it’s easier for them to find the pizza they would like to order or review. I wanted my project to include more functionality than what I’m used to in order to challenge myself and I’m delighted to see it up and running how I imagined it to be. I took a lot of tweeking and going back and forth, but all I have left now is to make it look pretty. I hope to accomplish the CSS part of it within the next couple of days so that I have enough time to study for the assessment and go over concepts that I still feel blurry about.

Routes

--

--