diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-03-05 10:52:22 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-03-05 10:52:22 +0000 |
commit | be62024c25659b47ab4edab042455022a4090f95 (patch) | |
tree | 605ec18c51479ad3177e984c84296ed51049526d /actionpack | |
parent | a96272a0c59b75a6838936af1eb7568b6136945a (diff) | |
download | rails-be62024c25659b47ab4edab042455022a4090f95.tar.gz rails-be62024c25659b47ab4edab042455022a4090f95.tar.bz2 rails-be62024c25659b47ab4edab042455022a4090f95.zip |
Documenation for has_one/has_many nested resource options. Closes #11195 [miloops]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8982 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/resources.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/resources.rb b/actionpack/lib/action_controller/resources.rb index 52173bc8bb..20fa3b9904 100644 --- a/actionpack/lib/action_controller/resources.rb +++ b/actionpack/lib/action_controller/resources.rb @@ -244,6 +244,21 @@ module ActionController # product.resources :product_reviews, :as => 'comentarios' # end # + # * <tt>:has_one</tt> - specify nested resources, this is a shorthand for mapping singleton resources beneath the current. + # * <tt>:has_many</tt> - same has :has_one, but for plural resources. + # + # You may directly specify the routing association with has_one and has_many like: + # + # map.resources :notes, :has_one => :author, :has_many => [:comments, :attachments] + # + # This is the same as: + # + # map.resources :notes do |notes| + # notes.resource :author + # notes.resources :comments + # notes.resources :attachments + # end + # # * <tt>:path_prefix</tt> - set a prefix to the routes with required route variables. # # Weblog comments usually belong to a post, so you might use resources like: |