Rebuilding Rails

Understand Rails by Building a Ruby Web Framework

How Would An Expert Learn Rails?

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)
I'm ready!
Buy the Book

Build Your Framework

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.

Reactions to Rebuilding Rails

"So far it's excellent, something I was searching for after Day #1 of Owning Rails"
- Erich Kaderka
"Every chapter is a series of a-ha! moments. Reading your book, I feel I became better at Rails. Even if I wasn't working with it."
- Exequiel Rozas
"I thought it was great! Knowing how your tools work under the hood is the best way to understand and master them, and that's exactly what Rebuilding Rails does. I really liked how you focused on one piece at a time while providing exercises and context from Rails. Great stuff."
- Jesse Storimer, Author of Working with Unix Processes
" I'm the type of developer that likes to know how things tick at a very deep level.

I've always wanted a book like this.. an intro to really diving deep with rails. "
- Kirk Quesnelle
"Yeah, I'm liking it. I learned a lot in the giveaway chapters so I decided to dive in."
- Josh Crews
" Okay, damn you, you win! I'll buy the book: the exercises are just too good. Your preference for extracting and examining information usually left implicit is perfect for me. You write as though your audience has minimal knowledge and limitless intelligence. "
- Eli Riter
" One of the best Ruby E-Books that I have ever read. Building a Rails-like Framework is an awesome way to teach internals of Rails and you are doing it really well.
- Imran Latif, professional Rails engineer

Future-Proof Mastery

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.

Debug Rails, Minus the Frustration

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?

Table of Contents.
Updated as chapters are completed.

What You'll Learn

Every chapter of Rebuilding Rails is about building a system from Rails. Models, controllers, database access, routing...

  • Gems, Gemfiles and Frameworks
  • Controllers and Routing
  • Automatic Class and File Loading
  • Views and Templating
  • Models from Files
  • Requests and Responses
  • ORMs and Database-Backed Models
  • Advanced Rack for All Frameworks
  • Advanced Routing

Every chapter teaches you more Ruby magic, which makes Rails more transparent.

Your welcome message will contain a download link for your chapters.

Should You Be a Rebuilder?

You should rebuild if:

  • You're an intermediate Rails programmer and want to go deeper
  • You want to contribute to Rails, but have no idea how it works
  • You love to know how everything works
  • You want to learn at your own pace, but blog posts are just too shallow

Do NOT buy if:

  • You're entirely new to Ruby
  • You want an API guide, not structural rebuilding.
  • You're a seriously advanced Rails programmer and already read the source code regularly
  • The style in the sample chapters really doesn't work for you

Worried that you need more Ruby or Rails chops? I recommend Michael Hartl's excellent Rails 3 tutorials, available for free online.

You'll Have My Support

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.

Me and my family

What Do Other People Think?

Minimize Your Risk

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.

Try It for Free

Sign up for my email list to get a bit more than two chapters, free. Or buy the book if you're convinced.

Your welcome message will contain a download link.

Get the Book

Book Cover
Ready to Rebuild?

  Buy the Book  

(60-day money-back guarantee)
Your welcome message will contain a download link.