diff options
author | Ryan Bigg <radarlistener@gmail.com> | 2010-11-07 12:21:56 +1000 |
---|---|---|
committer | Ryan Bigg <radarlistener@gmail.com> | 2010-11-07 12:21:56 +1000 |
commit | ff3a494e2e3cf52193d42ba7ed8252759de57c01 (patch) | |
tree | b19380e38cb434a8fa5149f4ef6c0c715c19dc0c /actionpack/lib | |
parent | e6aed6b6a8fd03584141c7dffd73c12ed32ce3d4 (diff) | |
download | rails-ff3a494e2e3cf52193d42ba7ed8252759de57c01.tar.gz rails-ff3a494e2e3cf52193d42ba7ed8252759de57c01.tar.bz2 rails-ff3a494e2e3cf52193d42ba7ed8252759de57c01.zip |
Document the :shallow_path option for scope
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 3e0802f3fc..a7d85dd3b5 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -493,6 +493,25 @@ module ActionDispatch # end # # Helpers such as +posts_path+ will now be +sekret_posts_path+ + # + # [:shallow_path] + # + # Prefixes nested shallow routes with the specified path. + # + # scope :shallow_path => "sekret" do + # resources :posts do + # resources :comments, :shallow => true + # end + # + # The +comments+ resource here will have the following routes generated for it: + # + # post_comments GET /sekret/posts/:post_id/comments(.:format) + # post_comments POST /sekret/posts/:post_id/comments(.:format) + # new_post_comment GET /sekret/posts/:post_id/comments/new(.:format) + # edit_comment GET /sekret/comments/:id/edit(.:format) + # comment GET /sekret/comments/:id(.:format) + # comment PUT /sekret/comments/:id(.:format) + # comment DELETE /sekret/comments/:id(.:format) def scope(*args) options = args.extract_options! options = options.dup |