Ruby on Rails Project

Posted by Uma Manandhar on May 14, 2020

So here I am, on my 3rd (and one of the most intense) project: Ruby On Rails. After the Sinatra project, I was very excited about Rails because I heard a lot of people saying how magical the Rails framework is and how broad it is. I was desperately waiting for that magic to happen but as I was getting deeper into it, I realized there was no actual magic in rails or any other programmes. There is hardwork and dedication behind this ‘magic’.

This time I was a little nervous about the project because it has a lot of requirements and functionalities. Therefore, I started my project a week earlier than the actual project mode began - and I am glad that I did it because there was way more logic and conditions to consider outside of the requirements.

At the beginning of my rails project, I struggled with model associations for a while. I was going back and forth to lessons and even a few references on ‘rails docs’. After all that and consulting with fellow cohort students, I was able to establish my has_many, has_many_through, belongs_to and many_to_many relationships between my models.Then I made sure it was working by seeding data with rake db:seed and testing them in rails console.

I knew this was a very important part of the project so I wanted to make sure my models and their relationships were working fine before moving forward on the project. Since, I have not used the rails console much in previous projects, it was fun to play around with it and discover all I could do. I especially liked the “rails c -s” command which lets you practise without saving any data in the database.

After setting up the models, I created all the routes, controller and views folders - and I must say, Rails generators are amazing. They make the coder’s lives way easier. Maybe this is where that magic lives… Anyway, I used them to create migrations, models, controllers, add and remove columns - and here’s a bonus: rails resource generator is great because it does all these functions at once. I had so much fun using all the rails generators, especially this one.

The next thing which I struggled with was “Bootstrap”. Even though I was not required to use it (or any other designs for that matter), I wanted to make my app to at least look presentable. So I decided to add it and I was really excited to see the outcome! I found that a lot of my fellow cohorts had the same thought, but later I realized that Bootstrap is something that we should set up at the end because it could waste a lot of your time. This was very important for us to consider since we only had two weeks to finish this project. So I again switched gears and began focusing on passing all the requirements and functionalities.

I learned a lot during this project. Some of the things I learned were displaying error messages, scope methods, omniauth(third party log in function), nested resources etc. Most importantly, I learned what to do when I get stuck? Most of the time when I got stuck I would tend to let my brain go everywhere and think about every possibility. I overcame that habit by taking things one step at a time. Going slow and focusing on only one thing at a time helped me a lot to solve most of my problems and errors. Also, I built a small side project to play around with to better increase my skills and knowledge. On my side project I would usually break it to see what happens and what kind of errors I get. That helped me to better understand how things worked. Rails documents were also very helpful - they basically have everything you’d ever want to know about rails.

Overall this project was full of ups and downs. It was fun to build this project and I had a great experience. Thank you