🎼 Ruby to Rails

JoAnna Park
4 min readSep 1, 2020

I cannot believe that it has already been 4 weeks since the start of boot camp. There is so much material that is covered in such a short span of time, I feel like time slows down when I am learning and processing the information. Starting from week 4, we have transitioned from learning Ruby, a programming language, to Rails, a web application framework. This transition has been a really challenging experience for me in many different ways. I felt very frustrated and incompetent during the first couple days after being introduced to Rails, because it was hard for me to tie the relationship between Ruby and Rails, as in I didn’t really understand how the work I put into learning Ruby was going to help me build a Rails application.

I needed to find an escape from these feelings of frustration and discouragement. And so, to reminisce over the good old days of when we mastered Ruby, I opened up the Ruby project I had worked on with my incredible partner/friend. My partner had come up with a brilliant idea of creating an application that would store the favorite songs of our cohort. He even went above and beyond to actually put together a playlist on Spotify. I put on the playlist so I could have some music playing in the background as I continued to study and work on labs in frustration.

As I slowly started to pay more attention to the music rather than the labs I was supposed to be finishing, I had a thought. Every song on this playlist was going to forever contain the memories of my cohort and my experience in this boot camp. And those memories will also continue to live in the CLI application my partner and I built . This thought was a huge revelation and motivation for me because these are the things I truly care about. I care about the connections I make with people and the things I learn from those connections and experiences.

So… I decided that I would start my own project of transferring our CLI application project into a Rails project. It’s definitely not even close to being finished, but here are some of the baby steps I have taken in making the transition:

First, I used the resource generator to create the routes and the model classes with their attributes. I have been taking advantage of this generator, as it sets up the routes, the classes and their tables all in one command.

The next step was to make sure that the associations were correct and working. This step was easy to do since I just had to transfer what I already had from the original project. I also decided to transfer over the seed file so that I would have some data to work with in the new project.

Then, I wrote the codes for the controller pages so that requests can be sent to the controller.

I wrote out methods in the controller that I would need in order to view a list of Students, to view the information of each Student, and then to be able to add a new Student, update the info and also to delete. It was nice to be practice some of the refactoring we had learned to do for the methods that required the specific id of a student and also the strong params for create and update.

After I wrote out the controllers needed to process the URL requests, I created the index and show pages so that I could see the list of all the Students in the data. The index page contains a complete list of all the Students as links so that the show page could be viewed for each student. The show page contains the attributes of the specified student and buttons to either edit or delete the student.

The last step I did was creating the form to add a student or to edit one. I put the form in a new erb file and rendered this file in the edit and new erb files to keep the files as clean as possible. I also did all of these steps for the Song class.

The parts I’ve completed so far are basically what our cohort learned and practiced during the first week of learning Rails. I really hope to continue adding to this project. My next step would be to add some validations and the other cool CRUD features we were able to add in the original project.

--

--