Book description
The Rails routing system has always been a key component of theframework, and with the introduction of RESTful routes in the pastyear, it has taken center stage. Fully programmable, the routing systemgoverns the process of mapping request URLs to the appropriatecontroller action. Routing also helps you when you’re writing code,especially view templates, where the same logic that interprets URLsworks in reverse to automate the generation of URL strings in yourcode. As all routing is rule-based, you have to know how to write therules to get the most out of the routing system. In this short cut, you’lllearn techniques for writing custom routing rules, how to tap into theconvenience and power of named routes, and the workings of theRESTful routing that’s had such an impact on Rails development.
Along with a thorough introduction to routing syntax and semantics,you’ll find techniques for testing and troubleshooting routes, and tipson the use of this important part of your Rails skill set.
Section 1: What This Short Cut Covers 3
Section 2: Introduction 6
Section 3: The Routing System 13
Section 4: Writing Custom Routes 31
Section 5: Named Routes 45
Section 6: REST, Resources, Representations, Routing, and Ruby on Rails 53
Section 7: Reflecting on Routes 91
Further Resources 112
Acknowledgments 113
About the Author 114
Table of contents
- Copyright
- 1. What This Short Cut Covers
- 2. Introduction
- 3. The Routing System
- 4. Writing Custom Routes
- 5. Named Routes
-
6. REST, Resources, Representations, Routing, and Ruby on Rails
- 6.1. REST in a Rather Small Nutshell
- 6.2. REST in Rails
- 6.3. Routing and CRUD
- 6.4. Resources and Representations
- 6.5. From Named Routes to REST Support
- 6.6. Reenter the HTTP Verb
- 6.7. The Standard RESTful Controller Actions
- 6.8. Singular and Plural RESTful Routes
- 6.9. The Special Pairs: new/create and edit/update
- 6.10. Nested Resources
- 6.11. Adding Custom Actions with :member and :collection
- 6.12. Controller-Only Resources
- 6.13. Singleton Resource Routes
- 6.14. Returning Different Representations
- 6.15. At Home with the Rails REST Action Set
- 7. Reflecting on Routes
- Further Resources
- Acknowledgments
- About the Author
- Also Available in The Addison-Wesley Professional Ruby Series
Product information
- Title: Rails Routing
- Author(s):
- Release date: May 2007
- Publisher(s): Addison-Wesley Professional
- ISBN: None
You might also like
book
Rails Plugins: Extending Rails Beyond the Core
One of the most powerful aspects of the Rails framework is the ability to extend and …
book
Rubyisms in Rails
Rubyisms is an examination of how the style of Ruby informs the design of Rails. In …
book
Rails Crash Course
In Rails Crash Course, author Anthony Lewis shows you how to harness Rails to build web …
book
Vue on Rails: End-to-End Guide to Building Web Apps Using Vue.js and Rails
Build modern and progressive web applications with Vue.js and Ruby on Rails. As the Rails community …