Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

path_names not working in nested routes

#4159

the option of path_names is not working in nested resources.

in the example route.rb below:

map.resources :user, :only => [:show] do |user|
   user.resources :setting, :only => [:index, :create, :show, :update]
   user.resources :posts, :only => [:index, :create] do |posts|
   posts.resources :setting, :only => [:index], :path_names => {:index => 'index_setting'}
   end
end

the route, "/user/:user_id/posts/:post_id/setting" should have the endpoint 'index_setting' but it is still 'index'

have tested it on rails 2.3.5.

Reported by deepak · March 12th, 2010 @ 11:05 AM

State: invalid
Milestone: 2.3.6
Assigned to: nobody
Importance: none

Activity

  1. Andrew White
    Andrew White

    The path_names option only applies to actions that add to the path like new, edit and any additional member actions you add. In your example to change setting to index_setting then you'd need to use the :as option.

    March 28th, 2010 @ 12:48 PM

  2. Rizwan Reza
    Rizwan Reza
    • Milestone set to 2.3.6
    • State changed from new to invalid

    March 28th, 2010 @ 07:49 PM