This project is archived and is in readonly mode.
Redirect broken when using namespaces in routes.rb
-
Ryan Bigg
Could you please submit a failing test for this?
-
wildchild
With pleasure.
-
Tyler Hunt
This also fails with the same error when using #root:
namespace :admin do root :to => redirect('/admin/companies') resources :companies end -
Andrew White
Attached patch fixes this issue.
I've written it so that the redirect path is namespaced which seems logical to me:
namespace :admin do root :to => redirect('/companies') resources :companies endIf you don't want it this way then let me know and I'll change the patch.
-
Damien MATHIEU
If the redirect path is namespaced, it mean we can't redirect to a path outside of the current namespace. That doesn't seem so logical to me.
-
Andrew White
I thought about that and you'd handle that situation like this:
match '/admin', :to => redirect('/other')To me it seems everything within a namespace block should be namespaced.
-
Repository
- State changed from open to resolved
(from [df15ba7eadb180626474161741f901e675f517ce]) Fix namespaced redirects [#4389 Redirect broken when using namespaces in routes.rb state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/df15ba7eadb180626474161741f901...
