Write Software, Well
The Rails Router

The Rails Router

Everything you need to know about the incredible routing system in Rails.

If you're new to Rails, or like me, interested in learning the fundamentals of Rails with a fresh pair of eyes and with the mindset of a beginner, I hope this small handbook will teach you a thing or two that you didn't know before, giving you a much better and deeper understanding and appreciation of the Rails Router.

Table of Contents

20 chapters
  1. 1 Preface
  2. 2 What is Routing?
  3. 3 The Rails Router
  4. 4 Router Configuration
  5. 5 Digging Deeper: Router Internals
  6. 6 Match Method
  7. 7 Dynamic Segment Keys
  8. 8 Query Strings
  9. 9 Segment Constraints
  10. 10 Named Routes
  11. 11 Override ID Param
  12. 12 Resourceful Routes
  13. 13 Custom Routes
  14. 14 Nested Resources
  15. 15 Shallow Nested Routes
  16. 16 Route to Rack
  17. 17 Routing Concerns
  18. 18 Root Route
  19. 19 How to Redirect Requests
  20. 20 Resources: Where to Go From Here