Understand Rails by Building a Ruby Web Framework
After three hours of searching incomplete and inconsistent API documentation, you know there must be a better way. The real experts don't learn it this way.
How would they learn how Rails works?
Like this:
The magic thing about Rails is when I looked at it the first time, I knew how it worked because I already knew Ruby really well.
I saw all the metaprogramming tricks; they were almost transparent, looking at it. But I didn't know you could put it together that way and create something so expressive and succinct.
— Chad Fowler, episode 1 of The Ruby Hangout (0:41:48)
With Rebuilding Rails, you'll build an MVC web framework, structured like Rails and using the same underlying libraries and tricks. You'll learn the magic behind Rails. You'll finish each system and solidify your knowledge with structured exercises. And you'll understand Rails like only a framework builder can.
When your upgraded controller and filter code raises yet another exception, it's because Rails changed under you. When you apply a few tweaks you Googled and it's only mostly fixed, you know there's a better way.
There is.
You can learn the fundamentals of every Ruby web framework in a future-proof way... by learning the layer that Rails is building on. To learn Rails the way the experts do, you'll have to learn Rack, Ruby's portable HTTP API.
That's hard. The Rack documentation is often wrong and frequently gives you only the name of a method or class, not what in the world it actually does.
Rebuilding Rails will take you through building a real, functional Rack framework. Building on Rack is the only way to really understand Rack.
You've spent hours tracing through before_filters and plugins. You've wondered why your controller variable isn't being passed through. You've spent your share of days on five-minute bugs.
You'll do better when you can see more of what's underneath.
But to do that, you can read a lot of source code... Or you can rebuild it yourself. Get the gut-level, instinctive understanding of Rails that you can only get by building it yourself.
Next time you debug a Ruby web app, what if you knew how every layer worked?
Every chapter of Rebuilding Rails is about building a system from Rails. Models, controllers, database access, routing...
Every chapter teaches you more Ruby magic, which makes Rails more transparent.
You should rebuild if:
Do NOT buy if:
Worried that you need more Ruby or Rails chops? I recommend Michael Hartl's excellent Rails 3 tutorials, available for free online.
I've written a lot of great information for you and tested it with my beta audience of hundreds of dedicated readers and programmers. You'll also get my personal email address — I read every message and I reply quickly. Email me before your purchase and after it. I love hearing from readers.
I read every piece of reader email personally.
I'm an author, speaker, paid Rails expert for Carnegie Mellon, professional Ruby programmer and the author of a lot of Ruby and Rails software.
I want more people to understand Ruby and Rails. I'll help you.
You'll get free updates for life. You'll also get a 60-day money-back guarantee. If you're not 100% sure you got your money's worth, I'll refund it with no questions asked.
If there are any revisions or errata, you'll also get free updates for life.
Sign up for my email list to get a bit more than two chapters, free. Or buy the book if you're convinced.