This project is archived and is in readonly mode.

#4389 ✓resolved

Redirect broken when using namespaces in routes.rb

Reported by wildchild | April 14th, 2010 @ 03:14 AM

In order to be redirected to /admin/dashboard from /admin I defined the following routes:

namespace :admin do
  match "/", :to => redirect("/admin/dashboard")
  match "/dashboard", :to => "dashboard#index", :as => :dashboard

It results in: "ActionController::RoutingError (uninitialized constant Admin::Controller):"

Different one works as expected:

match "/admin", :to => redirect("/admin/dashboard")
namespace :admin do
  match "/dashboard", :to => "dashboard#index", :as => :dashboard

But I can't relax, it seems something wrong in the router internals, right?

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>


Referenced by