This project is archived and is in readonly mode.
resource/resources inside namespace generates wrong routes
-
gucki
- Tag changed from regression, router to rails3 routes, regression, router
Nicer display of thew generated routes:
GET /my/text(.:format) {:action=>"show", :controller=>"my/texts"} POST /my/text(.:format) {:action=>"create", :controller=>"my/texts"} PUT /my/text(.:format) {:action=>"update", :controller=>"my/texts"} my_text DELETE /my/text(.:format) {:action=>"destroy", :controller=>"my/texts"} new_my_text GET /my/text/new(.:format) {:action=>"new", :controller=>"my/texts"} edit_my_text GET /my/text/edit(.:format) {:action=>"edit", :controller=>"my/texts"} new_a_text GET /a/text/new(.:format) {:controller=>"a/texts", :action=>"new"} edit_a_text GET /a/text/edit(.:format) {:controller=>"a/texts", :action=>"edit"} a_text GET /a/text(.:format) {:controller=>"a/texts", :action=>"show"} PUT /a/text(.:format) {:controller=>"a/texts", :action=>"update"} DELETE /a/text(.:format) {:controller=>"a/texts", :action=>"destroy"} POST /a/text(.:format) {:controller=>"a/texts", :action=>"create"} -
gucki
And just for completeness, the same bug is present with resourceS inside namespace:
GET /my/texts(.:format) {:controller=>"my/texts", :action=>"index"} my_texts POST /my/texts(.:format) {:controller=>"my/texts", :action=>"create"} new_my_text GET /my/texts/new(.:format) {:controller=>"my/texts", :action=>"new"} GET /my/texts/:id(.:format) {:controller=>"my/texts", :action=>"show"} PUT /my/texts/:id(.:format) {:controller=>"my/texts", :action=>"update"} my_text DELETE /my/texts/:id(.:format) {:controller=>"my/texts", :action=>"destroy"} edit_my_text GET /my/texts/:id/edit(.:format) {:controller=>"my/texts", :action=>"edit"} a_texts GET /a/texts(.:format) {:controller=>"a/texts", :action=>"index"} POST /a/texts(.:format) {:controller=>"a/texts", :action=>"create"} new_a_text GET /a/texts/new(.:format) {:controller=>"a/texts", :action=>"new"} edit_a_text GET /a/texts/:id/edit(.:format) {:controller=>"a/texts", :action=>"edit"} a_text GET /a/texts/:id(.:format) {:controller=>"a/texts", :action=>"show"} PUT /a/texts/:id(.:format) {:controller=>"a/texts", :action=>"update"} DELETE /a/texts/:id(.:format) {:controller=>"a/texts", :action=>"destroy"} -
gucki
Ok, the bug seems to happen even without namespace:
Test::Application.routes.draw do |map| resources :as map.resources :bs end
GET /as(.:format) {:controller=>"as", :action=>"index"} as POST /as(.:format) {:controller=>"as", :action=>"create"} new_a GET /as/new(.:format) {:controller=>"as", :action=>"new"} GET /as/:id(.:format) {:controller=>"as", :action=>"show"} PUT /as/:id(.:format) {:controller=>"as", :action=>"update"} a DELETE /as/:id(.:format) {:controller=>"as", :action=>"destroy"} edit_a GET /as/:id/edit(.:format) {:controller=>"as", :action=>"edit"} bs GET /bs(.:format) {:controller=>"bs", :action=>"index"} POST /bs(.:format) {:controller=>"bs", :action=>"create"} new_b GET /bs/new(.:format) {:controller=>"bs", :action=>"new"} edit_b GET /bs/:id/edit(.:format) {:controller=>"bs", :action=>"edit"} b GET /bs/:id(.:format) {:controller=>"bs", :action=>"show"} PUT /bs/:id(.:format) {:controller=>"bs", :action=>"update"} DELETE /bs/:id(.:format) {:controller=>"bs", :action=>"destroy"} -
gucki
- Tag changed from rails3 routes, regression, router to rails3 routes, patch, regression, router
The attached patch seems to fix the bugs for me. Please review :-)
-
gucki
Hm, lighthouse seems to have some troubles with the attached file. Here it is again.
-
gucki
As the attachment is still not loading, here as a pastie: http://pastie.org/1059180
-
Santiago Pastorino
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale
