| CODENOTIFIER | HelpYou are not signed inSign in |
Project: reststop
Revision: 46
Author: gunark
Date: 10 Mar 2008 13:58:54
Changes:Diff:| ... | ...@@ -267,11 +267,22 @@ | |
| 267 | 267 | # end |
| 268 | 268 | # end |
| 269 | 269 | # |
| 270 | # Custom actions are also possible. For example, to implement a 'meow' | |
| 271 | # action simply add a 'meow' method to the above controller: | |
| 272 | # | |
| 273 | # # POST/GET/PUT/DELETE /kittens/meow | |
| 274 | # # POST/GET/PUT/DELETE /kittens/(\d+)/meow | |
| 275 | # def meow(id) | |
| 276 | # end | |
| 277 | # | |
| 278 | # Note that a custom action will respond to all four HTTP methods | |
| 279 | # (POST/GET/PUT/DELETE). | |
| 270 | 280 | # |
| 271 | 281 | # Optionally, you can specify a <tt>:prefix</tt> key that will prepend the |
| 272 | # given string to the routes. For example, the following will create all of | |
| 273 | # the above routes, prefixed with "/pets" (i.e. <tt>POST '/pets/kittens'</tt>, | |
| 274 | # <tt>GET '/pets/kittens/(\d+)'</tt>, etc.): | |
| 282 | # given string to the routes. For example, the following will create all | |
| 283 | # of the above routes, prefixed with "/pets" | |
| 284 | # (i.e. <tt>POST '/pets/kittens'</tt>, <tt>GET '/pets/kittens/(\d+)'</tt>, | |
| 285 | # etc.): | |
| 275 | 286 | # |
| 276 | 287 | # module Foobar::Controllers |
| 277 | 288 | # class Items < REST 'kittens', :prefix => '/pets' |