title: Rails 3 routes for single controller and multiple resources
body: <p>I have multiple resources (<code>:countries, :states, :schools</code> etc.) but would like a single "Dashboard" controller to handle all the actions.</p>
  
  <p>I would like to be able to do the following:</p>
  
  <p><code>countries_path</code> would direct me to a <code>show_countries</code> action in the <code>DashboardController</code> and be accesible by <code>'/dashboard/countries</code>.</p>
  
  <p>Likewise for states, schools, etc.</p>
  
  <p>I've read up on Rails routing and have been messing around with various options. I ended up with the following in my <code>routes.rb</code> file:</p>
  
  <pre><code>scope "toolbox" do
    resources :countries, :controller =&gt; "toolbox", :only =&gt; :index do
      get 'show_countries', :on =&gt; :collection
    end
  
    ...
  end
  </code></pre>
  
  <p>Running <code>rake routes</code> gives me the following for the code above:</p>
  
  <pre><code>show_countries_countries GET    /toolbox/countries/show_countries(.:format)  {:action=&gt;"show_countries", :controller=&gt;"toolbox"}
  countries GET    /toolbox/countries(.:format)  {:action=&gt;"index", :controller=&gt;"toolbox"}
  </code></pre>
  
  <p>I've tried this:</p>
  
  <pre><code>scope "toolbox" do
    resources :countries, :controller =&gt; "toolbox", :only =&gt; :index, :action =&gt; "show_countries"
  end
  </code></pre>
  
  <p>only to get this route:</p>
  
  <pre><code>countries GET    /toolbox/countries(.:format)  {:action=&gt;"index", :controller=&gt;"toolbox"}
  </code></pre>
  
  <p>What I really want is this:</p>
  
  <pre><code>countries GET    /toolbox/countries(.:format)  {:action=&gt;"show_countries", :controller=&gt;"toolbox"}
  </code></pre>
  
  <p>Any ideas?</p>