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 !