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