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_prefix doesn't work

#4053

Using :path_prefix in resources routes doesn't seem to do anything in current edge rails (529d0f581276f9aad32432ef65421bc1a59b52e8). Though according to the routing guide it should.

Reproduce by...

rails my_app
cd my_app
script/rails g scaffold Movie title:string

edit config/routes.rb to:
resources :movies, :path_prefix => "/test"

rake routes

And notice how path_prefix has not been added to the routes.

Reported by DavidBackeus · February 25th, 2010 @ 01:09 PM

State: wontfix
Milestone: 3.0.2
Assigned to: josh josh
Importance: none

Activity

  1. Nathan L. Walls
    Nathan L. Walls

    I am also having this problem with the Rails 3 beta.

    March 2nd, 2010 @ 03:45 AM

  2. José Valim
    José Valim
    • Assigned user set to josh
    • Milestone cleared.

    March 3rd, 2010 @ 08:39 AM

  3. josh
    josh
    • State changed from new to wontfix

    Take a look at the scope method

    scope "/test" do
      resources :movies
    end
    

    March 6th, 2010 @ 07:15 PM

  4. Nathan L. Walls
    Nathan L. Walls

    I've tested with Joshua's scope example above, and that does have the desired effect. However, the routing documentation seems stale. The scope option is not mentioned, while :path_prefix still figures prominently in the documentation with :name_prefix.

    Since this is a wontfix, code-wise, could the case address the documentation instead? If not, what's the best avenue for resolving the docs?

    March 6th, 2010 @ 09:55 PM

  5. siong1987
  6. Jeremy Kemper