# Problem with nested shallow in admin namespace

**URL:** <https://www.ruby-forum.com/t/problem-with-nested-shallow-in-admin-namespace/162190>\
**Category:** Rails\
**Created:** [March 6, 2009, 3:28pm UTC](https://www.ruby-forum.com/t/problem-with-nested-shallow-in-admin-namespace/162190 "2009-03-06T15:28:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pietia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/d07c76/32.png) [@pietia](https://www.ruby-forum.com/u/pietia)\
**Post date:** [March 6, 2009, 3:28pm UTC](https://www.ruby-forum.com/t/problem-with-nested-shallow-in-admin-namespace/162190/1 "2009-03-06T15:28:25Z")

</div>

Hi all.

I have admin namespace with project resource connected to it ( as  
written in code below ). I need only to access blocks/sections/menus  
( which are all connected to projects in admin namespace ) via project  
( for example admin/projects/1/menu/1 ).

I thought about shallow =\> true to make my life easier. and wrote  
something like this :

map.namespace :admin do |admin|  
admin.resources :projects, :shallow =\> true, :has\_many =\>  
[:blocks, :sections, :menus] , :has\_one =\> [:language, :skin]  
end

( i assume there is something wrong )

Desire is that i will have access to /admin/projects/1/menus/1 via /  
admin/menus/1.

how can i define it correctly ( i mean routes code ) ?

Right now i got error :

Showing app/views/admin/projects/index.html.erb where line #24 raised:  
undefined method `admin\_project\_path’ for #\<ActionView::Base:  
0x26a55d4\>

I assume if i define shallow =\> true that i have still possibility to  
write admin\_project\_menu path to get what i want ( if im wrong and  
there is only menus\_path helper please tell me )

One more thing is that : normally with /admin/projects/2/menus i can  
just write @project = params[:project\_id] in menu\_controller  
index\_method and i will happily have access in menu\_index\_view to  
project ( which is parent of that menus in index ). How can i do it  
with shallow option if i have only admin/menus/ ??

Thank you for help !
