Problem with path helepers on nested routes


I have problem with this part of routes.rb

map.namespace :admin do |admin|
admin.resources :segment_schemas, :except => :show
admin.resources :languages
admin.resources :projects do |project|
project.resources :blocks
project.resources :sections
project.resources :menus, :has_many => [:menu_items]
project.resource :language
project.resources :skin
admin.resources :clients, :has_many => [ :projects ]
admin.resources :skins


while using this template :

<% for menu in @menus %>

<%=h menu.segment %> <%=h menu.title %> 15. <%= link_to 'show', [:admin,@project,menu] %> 16. <%= link_to 'edit', edit_admin_project_menu_path(menu) %> 17. <%= link_to 'delete', menu, :confirm => 'Are you sure?', :method => :delete %> <% end %>

<%= link_to ‘New menu’, new_admin_project_menu_path(@project) %>[/

it throws out :

Showing app/views/admin/menus/index.html.erb where line #16 raised:
edit_admin_project_menu_url failed to generate from
{:controller=>“admin/menus”, :action=>“edit”, :project_id=>1},
expected: {:controller=>“admin/menus”, :action=>“edit”}, diff:

I tried to define various parameters for routes but it just don’t
work :confused:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs