Skip to content

Commit

Permalink
updated readme with singleton resource that inherits from another con…
Browse files Browse the repository at this point in the history
…troller example
  • Loading branch information
shadowmaru committed Mar 18, 2009
1 parent ce9143f commit 5b0f4e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ If you want to create a singleton RESTful controller inherit from ResourceContro
class AccountsController < ResourceController::Singleton
end

...or if need to inherit from some other class:

class AccountsController < ApplicationController
resource_controller :singleton
end

*Note:* This type of controllers handle a single resource only so the index action and all the collection helpers (collection_url, collection_path...) are not available for them.

Loading objects in singletons is similar to plural controllers with one exception. For non-nested singleton controllers you should override the object method as it defaults to nil for them.
Expand Down

0 comments on commit 5b0f4e2

Please sign in to comment.