title: Rails routing error with namespaced items
body: <p>We've got a rails app that keeps producing an error that we can't track down. The problem seems to lie with the routing but we're not sure what is happening. Out routes file looks like:</p>
  
  <pre><code>  ActionController::Routing::Routes.draw do |map|
      # Default
      map.home '', :controller =&gt; "home"
  
      # Admin
  
      map.admin_home 'admin', :controller =&gt; 'admin/admin', :action =&gt; 'index'
      map.admin_login 'admin/login', :controller =&gt; 'admin/admin', :action =&gt; 'login'
      map.admin_reminder 'admin/forgot', :controller =&gt; 'admin/admin', :action =&gt; 'reminder'
      map.namespace :admin do |admin|
        admin.resources :bookings,
          :collection =&gt; {
            :archive =&gt; :get, :reports =&gt; :get, :calendar =&gt; :get,
            :step_1 =&gt; :any, :step_1a =&gt; :any, :step_2 =&gt; :any, :step_3 =&gt; :any, :confirmation =&gt; :any }
        admin.resources :events,
          :member =&gt; { :status =&gt; :get }
        admin.resources :blogs,
          :collection =&gt; { :archive =&gt; :get }
        admin.resources :blog_replies,
          :member =&gt; { :publish =&gt; :get }
        admin.resources :minutes,
          :collection =&gt; { :archive =&gt; :get }
        admin.resources :businesses
        admin.resources :business_categories
        admin.resources :users
        admin.resources :pricings
        admin.backups 'backups', :controller =&gt; 'admin/backups'
        admin.download_backup 'backups/download', :controller =&gt; 'admin/backups', :action =&gt; 'download'
      end
      map.admin 'admin/:action', :controller =&gt; 'admin/admin'
  
      map.connect 'members', :controller =&gt; 'admin/admin', :action =&gt; 'redirect_to_index'
      map.connect 'members/login', :controller =&gt; 'admin/admin', :action =&gt; 'redirect_to_index'
      map.connect 'account', :controller =&gt; 'admin/admin', :action =&gt; 'redirect_to_index'
      map.connect 'account/login', :controller =&gt; 'admin/admin', :action =&gt; 'redirect_to_index'
      map.connect 'home', :controller =&gt; 'admin/admin', :action =&gt; 'redirect_to_index'
      map.connect 'home/login', :controller =&gt; 'admin/admin', :action =&gt; 'redirect_to_index'
  
      map.blog 'blog/:permalink', :controller =&gt; 'blogs', :action =&gt; 'show'
      map.connect 'blog/:id', :controller =&gt; 'blogs', :action =&gt; 'show'
      map.connect 'book-online', :controller =&gt; 'bookings', :action =&gt; 'step_1'
      map.connect 'book-online/:action', :controller =&gt; 'bookings'
      # Defaults
      map.connect ':controller/:action/:id'
      map.connect "*anything", :controller =&gt; "public", :action =&gt; "unknown_request"
    end
  </code></pre>
  
  <p>We have a set of public controllers in app/controllers and a set of admin controllers in app/controllers/admin. The issue we keep seeing is when a user goes to a url like admin/bookings, admin/bookings/step_1 or admin/events. Sometimes the urls work perfectly but other times I can see from the log file that something like the following happens:</p>
  
  <pre><code>ActionController::UnknownAction (No action responded to index):
  </code></pre>
  
  <p>Other times we'll get something like:</p>
  
  <pre><code>Processing EventsController#index (for [filtered] at 2009-01-21 10:54:38) [GET]
  Session ID: [filtered]
  Parameters: {"action"=&gt;"index", "controller"=&gt;"admin/events"}
  Rendering template within layouts/public
  Rendering events/index
  Completed in 0.00863 (115 reqs/sec) | Rendering: 0.00338 (39%) | DB: 0.00000 (0%) | 200 OK [http://www.gresfordtrust.org/admin/events]
  </code></pre>
  
  <p>from the last example you can see that the url requested was <code>admin/events</code> which should have hit the <code>#index</code> in <code>Admin::EventsController</code> but instead it renders the <code>#index</code> action in <code>EventsController</code>.</p>
  
  <p>We're running the app with Rails 2.0.2.</p>