TL;DR: how to study and master the Rails Guides to level up and become an intermediate Rails developer.
It’s a bit embarrassing to admit that I was scared of the official Rails Guides. I much preferred video tutorials and blog posts over the official doc. Becuase video tutorials and blog posts seemed less intimidating and more hand-holding.
I avoided the official Rails Guides like the plague. Whenever I saw recommended Rails resources, the Rails Guides was always on top the list. But I was so afraid of it that my brain would automatically filter it out and go check out other resources on the list.
I was able to get by with jumpstart tutorials and the help of StackOverflow. But I wasn’t confident in my Rails knowledge. I knew how to make things happen but I didn’t really understand how different pieces were put together.
Each time I asked on the internet, I learned something new about Rails. But that only made Rails seemed more magical to me, which made me even less confident in my Rails knowledge. And every single time I asked for help, a specific section of the Rails Guides that answered my exact question would be referred to in a StackOverflow answer.
I was struggling to build a solid Rails foundations. And random online tutorials didn’t help much. Ironically, I kept ignoring the most recommended and obvious resource: the Official Rails Guides, the doc designed to do exactly what I needed: help beginners learn Rails foundations.
Fast forward the story. I faced my fear and decided to actually read the Rails Guides. I failed the first few times. But looking back, I would say it’s still the best resource to learn Rails. And nowadays I still refer back to it and learn from it.
If you are trying to avoid the Rails Guides as I did, I want to tell you I understand your fear (and that small hidden embarrassment) and you are not alone. I write this post to tell you the exact plan of attack to study and master the Rails Guides. Believe it or not, studying and mastering the basics, the Model-View-Controller sections, of the Rails Guides alone will make you an intermediate Rails developer.
The post is structured as follows:
- Why you feel the Rails Guides is intimidating
- Why you should learn to read the Rails Guides
- Plan of attack: How to master the Rails Guides
- Tips and Tricks
Why you feel the Rails Guides is intimidating
- Because as a beginner in programming, you are not used to reading technical documents.
- Although the Rails Guides is very well written, especially compared with many other technical documents, the Rails Guides is also very dense, long, and comprehensive. Unlike many blog posts, the Rails Guides is very concise. A short paragraph of it normally contains couple important concepts. It does require efforts and dedication.
- Reading is not the most effective, nor the most engaging way to learn. Passive learning, like reading and listening, is not effective. We, human, learn the fastest by doing, playing, and experimenting. (And the plan of attack takes this into account.) Forcing ourselves to read something long and dense with new concepts makes us want to run away from the material.
Why you should learn to read the Rails Guides
- It’s the best way to build a solid Rails foundation. If you survey Rails questions on StackOverflow, 8 out of 10 can be answered by some sections in the Rails Guides. In fact, answerer of a question would often include in his/her answer the exact section in the Rails Guides that already answered the question.
- The ability to read and learn from technical documents is critical to becoming a developer.
Plan of attack: How to master the Rails Guides
If you haven’t, go through Getting Started with Rails. That’s the fastest and easiest way to see how things are put together in a Rails app. Then follow these steps to master each article in the Model, View, and Controller sections of the Rails Guides.
- Skim Through It
- Study and Use It
- Come Back to It
1. Skim Through It
The goal of this step is to build up the big picture in your mind. Pay attention to the structures of each section and each article.
For example, there are six articles under the Model section. And there are eight chapters in the Active Record Basics article. Take a look at the chapter titles. If you are unfamiliar with any of them, click on it and take a brief look. For example, if you are not sure what CRUD means, click the link and take a brief look.
The goal is NOT to learn everything now but to put meanings to these terminologies.
Keep clicking, jumping, and skimming from articles to articles and sections to sections.
In the end, you should be able to draw a mind map to capture how all these articles fit together along with the contents of each article.
2. Study and Use It
Allocate dedicated time for each article. For example, you can spend a week on Active Record Associations.
First and foremost, gain an overview of what the article is about. Read the table of content and skim through the article. Know what topics it covers. For example, the Active Record Associations article has five chapters. They are 1. Why Associations?, 2. The Types of Associations, 3. Tips, Tricks, and Warnings, 4. Detailed Association Reference, and 5. Single Table Inheritance.
If I didn’t quite understand what is covered in 4. Detailed Association Reference, I would take a brief look. And based on my three-second glance, the chapter appeared to be about how to refer to each association and methods that come with it.
Now I have a rough idea of what the article is about, I can start studying the article. Studying contains three things:
- read it
- code it out
- take quizzes
Do NOT try to read through the whole article all at once. Stop reading as soon as you can play with what you just read.
Use the Active Record Associations article as an example. You should stop reading as soon as you finish 2.1 The belongs_to Association. Because at this point, you can actually code a
belongs_to association out and play with it. The article use a book belongs_to an author as an example. Try to come up with an example on your own. Can you code out the
a house belongs_to a user association? Play with your code. Does
my_house.owner gives you a user?
Don’t skip the coding-and-playing part. You can’t learn Rails by reading. You need to get your hands dirty.
After coding and playing, quiz yourself on what you just learn by trying to answer related questions on StackOverflow.
For example, search
Rails on StackOverflow and see if you can answer some of the questions people asked in the past. It’s likely that in the beginning, you are not able to answer many questions because some questions require more knowledge. That’s fine. As you progress, you will be able to answer more and more questions.
Don’t just check your answer against the accepted answers. Try it out on your own if possible. When it comes to programming, getting your hands dirty is the best way to learn.
Now you can move onto the next section: 2.2 The has_one Association.
Since you have learned about
belongs_to, when you are coding and playing with the
has_one association, try to use the
belongs_to association as well. For example, can you code out
a laptop belongs to a programmer and a programmer has one laptop? Does
my_laptop.owner.laptop equals to
Repeat these steps until you go through the whole article.
Then repeat for the next article until you go through all the articles in the Model, View, and Controller sections.
This process definitely takes a lot of time and efforts. But it’s worth it. You will come out with a very solid foundation for Rails.
Take your time and pace yourself.
Celebrate and reward yourself after each article because you are doing some really great work here.
Most importantly, don’t give up and don’t skip the coding and quizzing parts.
3. Come Back to It
Congrats! If you have arrived at this step, you have accomplished something big. ???
You should stop calling yourself a Rails newbie from now on.
By now, the Rails Guides should have become a buddy of yours.
The only thing you need to do at this step is to come back and visit your buddy whenever you are stuck and need help for either work projects or personal projects.
Whenever you are stuck, don’t jump straight to Google. Reread the relevant Rails Guides first.
4. Tips and Tricks
- Pay attention to the version of the Rails Guides you are reading.
- http://guides.rubyonrails.org points to the latest stable version by default.
- http://guides.rubyonrails.org/v4.2/ points to the guides for version 4.2. Simply append the version to the end of the URL to visit guides for older versions of rails.
- http://edgeguides.rubyonrails.org, or the Edge Guides, is the latest version (which might not be stable).
- Rails Guides are also available on Kindle. You can find it side panel of the home page.
- Send an article from your computer to your Kindle. Check out the Send to Kindle Chrome extension by Amazon.
- Download and print the kindle version so you can write notes directly on the pages.
Thanks for reading. I hope you enjoy the article. Please share and comment below about your Rails Guides mastering journey. I’m eager to read about your experience. If you have any tips about reading the Rails Guides, please share below as well.
Don’t forget to subscribe!
Enjoyed the article?
My best content on Rails, Software Design, and Career in Dev. Delivered weekly.