O'Reilly logo

Learning Rails: Live Edition by Edd Dumbill, Simon St. Laurent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Infinite Possibilities

Rails routing is implemented using a DSL—a Domain-Specific Language. Ruby lets developers build all kinds of functionality into a very concise form, but at the same time, DSLs can become pretty mind-bending quickly. Routing in particular can grow extremely complicated if you try to take advantage of too many cool Rails features. There are many, many more possibilities than a Learning book can reasonably cover. Among them are:

  • Using map.resources with a block

  • Custom parameters and conditions

  • Abandoning numeric id values in favor of more descriptive unique names

  • More precisely defined nested resources with path and name prefixes

  • Multiple levels of nesting

  • Testing routes with assert_generates, assert_recognizes, and assert_routing

  • Debugging routes from the console

  • Extending routing

Once you’ve run out of things to do with the possibilities explored in this chapter, and feel confident that you understand how Rails is routing requests, you can take the next steps forward into deepest Rails.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required