Looks like an error in docs for ActionDispatch::Routing::Mapper::Resources

Please take a look at this page:

It reads:

:path     Set a path prefix for this resource.         resources :posts, :path => "admin"     All actions for this resource will now be at /admin/posts.

For me (Rails 3.0.9) it routes to just "/admin", not "/admin/posts". In other words, it just renames the "posts" part of the URL to whatever specified rather than adding a prefix. I actually like this behavior (this is what I was looking for), but the docs are misleading.

Can anyone else check if the :path option works the same way for him/ her?

Just checked it, and you are correct. It looks like the API doc for this has been fixed in 3-1-stable and master:

https://github.com/rails/rails/commit/9f9446f27110a0d55462

but this hasn't been back-ported to 3-0-stable (yet).

Chris

Just pushed a backport for 3-0-stable. Thanks!