From 0c5ca0747f8bf0f24539be54bdb8dace9424c073 Mon Sep 17 00:00:00 2001 From: Lukasz Sarnacki Date: Tue, 27 Mar 2012 00:15:58 +0200 Subject: added shallow_prefix option description in documantation It is in response for confusion in issue #5301 --- actionpack/lib/action_dispatch/routing/mapper.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index cdc29fb304..94e4bbd0d5 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1134,6 +1134,25 @@ module ActionDispatch # comment PATCH/PUT /sekret/comments/:id(.:format) # comment DELETE /sekret/comments/:id(.:format) # + # [:shallow_prefix] + # Prefixes nested shallow route names with specified prefix. + # + # scope :shallow_prefix => "sekret" + # resources :posts do + # resources :comments, :shallow => true + # end + # end + # + # The +comments+ resource here will have the following routes generated for it: + # + # post_comments GET /posts/:post_id/comments(.:format) + # post_comments POST /posts/:post_id/comments(.:format) + # new_post_comment GET /posts/:post_id/comments/new(.:format) + # edit_sekret_comment GET /comments/:id/edit(.:format) + # sekret_comment GET /comments/:id(.:format) + # sekret_comment PATCH/PUT /comments/:id(.:format) + # sekret_comment DELETE /comments/:id(.:format) + # # === Examples # # # routes call Admin::PostsController -- cgit v1.2.3 From e01beb5b3b237c7c6bc8945a58ed85ff879109ec Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Tue, 27 Mar 2012 21:19:56 +0530 Subject: add missing do [ci skip] --- actionpack/lib/action_dispatch/routing/mapper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 94e4bbd0d5..29dba6c7aa 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1137,7 +1137,7 @@ module ActionDispatch # [:shallow_prefix] # Prefixes nested shallow route names with specified prefix. # - # scope :shallow_prefix => "sekret" + # scope :shallow_prefix => "sekret" do # resources :posts do # resources :comments, :shallow => true # end -- cgit v1.2.3