Browse the Ruby on Rails Community.

You are here: Browse Railsplugins Resources Controller

Resources Controller

http://plugins.ardes.com > resources_controller

= resources_controller

plugin to facilitate inheritance and DRYness in your resources controllers

Simple Usage (see Ardes::ResourcesController for more)

class ThingsController < ApplicationController
  resources_controller_for :things
end

Also supports nested resources

class CommentsController < ApplicationController
  resources_controller_for :comments, :in => [:forum, :post]
end

Also support polymorphic associations, and arbitrary nesting

class TagsController < ApplicationController
  resources_controller_for :tags
  nested_in :taggable, :polymorphic => true, :load_enclosing => true
end
  1. this controller will handle
  2. /forums/1/tags
  3. /forums/1/posts/2/tags
  4. /users/3/tags
  5. etc

=== For Rails <= 1.2.2

If you are using non-edge rails <= 1.2.2 you should also install http://svn.ardes.com/rails_plugins/resources_controller_lte_1_2_2

(To tell if you need the patch you can run the specs via rake – if you get failures to do with resource service, then you need the patch)

=== Contributors
  • Ian White
  • Igor Alexeiuk for work on name_prefix and polymorphic routes
  • Dan Kubb

See the {CHANGLELOG}[link:files/CHANGELOG.html] for recent changes

=== Specs and Coverage
  • {SPECDOC}[link:files/SPECDOC.html] lists the specifications
  • {RSpec Report}[link:rspec_report.html] is a report of spec pass/fails
  • {RCov Report}[link:coverage/index.html] is the rcov report

=== Testing

RSpec is used for testing, so the tests are in spec/ rather than test/ Do rake—tasks for more details.

NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly

Users


See all details


Membership

+ Join this railsplugin

Record Maintainer

'None'