How to Learn Ruby on Rails
Posted: Oct 25, 2016
You’ve just taken your first steps in programming and you’re already facing a common problem: you just don’t know where to begin and what to learn first. However, you know what technology you want to work with: Ruby on Rails. Congratulations! You’ve decided to join a vibrant community of likeminded people.
Here a few tools to help you learn the basics of front-end web development:
- The Intro to HTML and CSS course on Udacity doesn’t follow the structure of similar courses. This Udacity course gets you thinking like a real front-end developer: you won’t focus on a language’s syntax. Instead, you’ll learn how to convert design mockups to web pages step by step. What’s more, the course includes a chapter on responsive design techniques, something rarely taught within courses about HTML/CSS.
Just to be clear, Ruby is a programming language, while Ruby on Rails (hint: you’ll sound more knowledgeable if you just say "Rails") is a web application framework – a collection of pre-written code that simplifies website building. Rails extends the Ruby language and solves everyday problems so you don’t have to reinvent the wheel.
Beginner developers often wonder if they need to learn Ruby first before moving to Ruby on Rails. We think you should. Our advice is to learn Ruby first. Of course, Rails offers great solutions out of the box; but when you face more serious issues, you’ll have to struggle with the Ruby code.
There are many ways to learn Ruby: online courses, books, video tutorials, and even mentorship programs. If you want to learn independently, you’ll probably dig into books and online courses, which are popular today. But remember: no matter how you learn Ruby, the way to succeed is to practice what you learn. A common mistake of beginners is gaining book knowledge without practicing: theory is great, but if you can’t put it into practice it’s not worth much.
We’ve picked out a few books and courses that’ll help you learn the basics of Ruby:
Once you know all about Ruby, you can finally start learning Rails! This web application framework is a perfect solution for startups thanks to its extensive out-of-the-box functionality, deployment speed and scalability. Let’s see what online educational platforms and books you need to master the basics of RoR.
In general, online courses for Rails all look the same and offer the same products. We’ve picked out a few platforms that we personally like:
- Code School’s Rails for Zombies Redux courses. The playful name of this course shouldn’t fool you: you’ll learn CRUD principles, Active Record models and MVC architecture. This course is designed for those who already have some knowledge of programming, web development and Ruby. By the way – after successfully completing of this course you get a badge you can put on your CV.
We’ve also picked up a few books that our Ruby/Rails developers love and recommend.
- Agile Web Development with Rails 4 by Sam Ruby, David Thomas, and David Heinemeier Hansson. This is the ultimate guide to basics including Rails installation and architecture (models, views, and controllers). You’ll also learn a bit of Ruby before you create your very first storefront following the practical section of the book. Agile Web Development’s complexity increases gradually throughout the book. The Practical approach of this book is supported by story-driven chapters, iterative exercises and hand-holding narration.
Get yourself a Mentor
Getting yourself a mentor is important. First, you’ll speed up your learning process by having someone beside you who can explain difficult concepts, review your code and guide you to better solutions. Second, a mentor is a source of support who won’t let you stumble on a problem or make the mentor’s previous mistakes. We at RubyGarage have developed a culture of mentorship in our teams to build closer relationships between junior and senior developers and accelerate learning.
2. Boost Your Skills: Ruby/Rails Intermediate Level
After you’ve learned the Ruby/Rails basics, you’ll probably want to go further and build more complicated applications with features like import/export of data, implementation of public/ private APIs and admin panels. Here are some resources to help you get there:Become high-flying Rubyist
You shouldn’t underestimate the role of books in studying programming. Despite rapid development of technologies, good books on programming keep up with the times and are updated after new releases and updates. In order not to get lost in the many of books on Ruby and Rails, we’ve selected some especially good resources for you. Here are some books that contain information on extended Ruby features for the high-flying Rubyist:
- The Well-Grounded Rubyist (Second Edition) by David A.Black. This book assumes some programming background, however, you can always research unfamiliar concepts while you read. From the first to the last page Black introduces you to an object-oriented programming approach. For more experienced developers this book serves as a valuable reference; beginner Rubyists can get a great start from learning the basics (installing Ruby) to more advanced and dynamic Ruby features.
Practice makes perfect. At the beginning you’ll learn Ruby’s syntax and follow pre-written cases. But as you grow as a Rubyist, you need to put what you’ve learned into practice.
In order to deepen your knowledge, we recommend reading The Rails 4 Way by Obie Fernandez. This so-called "Bible" for Rails developers comes in the form of a reference book that you can refer to whenever you have any questions on a topic. Here you can find an answer to basically any question about Rails core. Readers also mark out in-depth narration and focus on practical chapters about gems and optimization of processes.Join Ruby/Rails communities
Don’t forget that Ruby/Rails has one of the friendliest and most vibrant communities! Don’t miss the chance to join a group of people who will share insights and support you. Here are a few useful resources for you to connect with the Ruby/Rails community:
- StackOverflow and Quora. StackOverflow is for developers of all kinds: here you can ask any question related to a software development topic and get an enthusiastic response. Quora, on the other hand, is a platform for sharing insights in various areas. On Quora you can ask technical questions as well as less complicated questions such as what programming language you should learn.
Once you've learned the fundamentals of Ruby and Rails, you still have work to do. It’s important to build your own applications to get as much experience as you can; make mistakes and learn how to fix them; and get lost in concepts and find solutions. An inspiring example is Jennifer Dewalt who has built 180 websites in 180 days : every time you think you’re about to give up, think of her incredible aspiration.
As soon as you start writing your own code, it’s important to improve your output. Pay attention to coding best practices including DRY (Don’t Repeat Yourself), KISS (Keep It Simple, Stupid), and YAGNI (You Aren’t Gonna Need It) that allow you to write maintainable code and prevent you from reinventing the wheel and adding gold plating (unnecessary extra features).
In the future you’re probably going to build web applications as a part of a team. That’s why it’s essential to learn Git – a version control system to maintain your code and save the latest versions. Git is a useful programming practice since it helps you backup changes to your code and monitor your work progress.Conclusion
Learning how to code is challenging, even though you can find plenty of resources that are crafted with diligence and passion. We’ve shared the books and websites we personally like and would recommend for individual study. But no matter what learning method you choose, remember to put theory into practice and get support from more experienced developers. Good luck!
Originally published at rubygarage.org.
Sviatoslav Andrushko is a content manager at RubyGarage. Sviat adores writing about web development, web design, testing, and other IT-related topics.