You are previewing The Rails™ 3 Way, Second Edition.

The Rails™ 3 Way, Second Edition

Cover of The Rails™ 3 Way, Second Edition by Obie Fernandez Published by Addison-Wesley Professional
O'Reilly logo

Chapter 2. Routing

I dreamed a thousand new paths... I woke and walked my old one.

—Chinese proverb

The routing system in Rails is the system that examines the URL of an incoming request and determines what action should be taken by the application. And it does a good bit more than that. Rails routing can be a bit of a tough nut to crack. But it turns out that most of the toughness resides in a small number of concepts. After you’ve got a handle on those, the rest falls into place nicely.

This chapter will introduce you to the principal techniques for defining and manipulating routes. The next chapter will build on this knowledge to explore the facilities Rails offers in support of writing applications that comply with the principles of Representational ...

The best content for your career. Discover unlimited learning on demand for around $1/day.