README.md in coach-0.3.0 vs README.md in coach-0.4.0
- old
+ new
@@ -222,23 +222,25 @@
```
## Routing
For routes that represent resource actions, Coach provides some syntactic sugar to
-allow concise mapping of endpoint to handler.
+allow concise mapping of endpoint to handler in Rails apps.
```ruby
-router = Coach::Router.new(Example::Application)
-
-router.draw(Routes::Users,
- base: "/users",
- actions: [
- :index,
- :show,
- :create,
- :update,
- disable: { method: :post, url: "/:id/actions/disable" }
- ])
+# config/routes.rb
+Example::Application.routes.draw do
+ router = Coach::Router.new(self)
+ router.draw(Routes::Users,
+ base: "/users",
+ actions: [
+ :index,
+ :show,
+ :create,
+ :update,
+ disable: { method: :post, url: "/:id/actions/disable" }
+ ])
+end
```
Default actions that conform to standard REST principles can be easily loaded, with the
users resource being mapped to: