title: Rails 3 resource routes missing paths
body: <p>I dont know what Ive done with this new app but my routes are really messed up. I seem to be missing a lot of paths for my resources which is wreaking havoc on my app. There are a few controllers that seem to be routing to one another. Ill post my routes files and my rake routes to explain:</p>
  <h2>routes file</h2>
  <pre><code>devise_for :users
  root :to =&gt; &quot;index#home&quot;
  
  #members section and its nested images
  resources :members, :except =&gt; [:new, :create] do
      resources :tattoos
  end
  
  #admin section
  namespace :admin do
    root :to =&gt; &quot;admin#index&quot;
  
    # pulls all users to manage
    resources :users do
      #pulls just admin/artist users
      collection do
        get 'admins'
        get 'artists'
      end
    end
  
    # Adds resources to manage (approve/reject) images
    resources :tattoos do
      # adds a couple extra actions on images
      collection do
        get 'reported'
        put &quot;mass_approve&quot;
      end
    end
  end
  
  
  #public tattoo viewing and submissions
  match &quot;/submit&quot; =&gt; &quot;index#new&quot;, :via =&gt; :get, :as =&gt; &quot;submit&quot;
  match &quot;/submit&quot; =&gt; &quot;index#create&quot;, :via =&gt; :post
  match &quot;/tattoo/:id&quot; =&gt; &quot;index#show&quot;, :via =&gt; :get, :as =&gt;&quot;tattoo&quot;
  match &quot;/tagged&quot; =&gt; &quot;index#tagged&quot;, :via =&gt; :get
  match &quot;/tattoo/:id&quot; =&gt; &quot;index#destroy&quot;, :via =&gt; :delete
  match &quot;/tattoos&quot; =&gt; &quot;index#index&quot;, :via =&gt; :get, :as =&gt; &quot;tattoos&quot;
  </code></pre>
  <h2>rake routes</h2>
  <pre><code>                      root        /(.:format)                                    {:controller=&gt;&quot;index&quot;, :action=&gt;&quot;home&quot;}
              member_tattoos GET    /members/:member_id/tattoos(.:format)          {:action=&gt;&quot;index&quot;, :controller=&gt;&quot;tattoos&quot;}
                             POST   /members/:member_id/tattoos(.:format)          {:action=&gt;&quot;create&quot;, :controller=&gt;&quot;tattoos&quot;}
           new_member_tattoo GET    /members/:member_id/tattoos/new(.:format)      {:action=&gt;&quot;new&quot;, :controller=&gt;&quot;tattoos&quot;}
          edit_member_tattoo GET    /members/:member_id/tattoos/:id/edit(.:format) {:action=&gt;&quot;edit&quot;, :controller=&gt;&quot;tattoos&quot;}
               member_tattoo GET    /members/:member_id/tattoos/:id(.:format)      {:action=&gt;&quot;show&quot;, :controller=&gt;&quot;tattoos&quot;}
                             PUT    /members/:member_id/tattoos/:id(.:format)      {:action=&gt;&quot;update&quot;, :controller=&gt;&quot;tattoos&quot;}
                             DELETE /members/:member_id/tattoos/:id(.:format)      {:action=&gt;&quot;destroy&quot;, :controller=&gt;&quot;tattoos&quot;}
                     members GET    /members(.:format)                             {:action=&gt;&quot;index&quot;, :controller=&gt;&quot;members&quot;}
                 edit_member GET    /members/:id/edit(.:format)                    {:action=&gt;&quot;edit&quot;, :controller=&gt;&quot;members&quot;}
                      member GET    /members/:id(.:format)                         {:action=&gt;&quot;show&quot;, :controller=&gt;&quot;members&quot;}
                             PUT    /members/:id(.:format)                         {:action=&gt;&quot;update&quot;, :controller=&gt;&quot;members&quot;}
                             DELETE /members/:id(.:format)                         {:action=&gt;&quot;destroy&quot;, :controller=&gt;&quot;members&quot;}
                  admin_root        /admin(.:format)                               {:controller=&gt;&quot;admin/admin&quot;, :action=&gt;&quot;index&quot;}
          admins_admin_users GET    /admin/users/admins(.:format)                  {:action=&gt;&quot;admins&quot;, :controller=&gt;&quot;admin/users&quot;}
         artists_admin_users GET    /admin/users/artists(.:format)                 {:action=&gt;&quot;artists&quot;, :controller=&gt;&quot;admin/users&quot;}
                 admin_users GET    /admin/users(.:format)                         {:action=&gt;&quot;index&quot;, :controller=&gt;&quot;admin/users&quot;}
                             POST   /admin/users(.:format)                         {:action=&gt;&quot;create&quot;, :controller=&gt;&quot;admin/users&quot;}
              new_admin_user GET    /admin/users/new(.:format)                     {:action=&gt;&quot;new&quot;, :controller=&gt;&quot;admin/users&quot;}
             edit_admin_user GET    /admin/users/:id/edit(.:format)                {:action=&gt;&quot;edit&quot;, :controller=&gt;&quot;admin/users&quot;}
                  admin_user GET    /admin/users/:id(.:format)                     {:action=&gt;&quot;show&quot;, :controller=&gt;&quot;admin/users&quot;}
                             PUT    /admin/users/:id(.:format)                     {:action=&gt;&quot;update&quot;, :controller=&gt;&quot;admin/users&quot;}
                             DELETE /admin/users/:id(.:format)                     {:action=&gt;&quot;destroy&quot;, :controller=&gt;&quot;admin/users&quot;}
      reported_admin_tattoos GET    /admin/tattoos/reported(.:format)              {:action=&gt;&quot;reported&quot;, :controller=&gt;&quot;admin/tattoos&quot;}
  mass_approve_admin_tattoos PUT    /admin/tattoos/mass_approve(.:format)          {:action=&gt;&quot;mass_approve&quot;, :controller=&gt;&quot;admin/tattoos&quot;}
               admin_tattoos GET    /admin/tattoos(.:format)                       {:action=&gt;&quot;index&quot;, :controller=&gt;&quot;admin/tattoos&quot;}
                             POST   /admin/tattoos(.:format)                       {:action=&gt;&quot;create&quot;, :controller=&gt;&quot;admin/tattoos&quot;}
            new_admin_tattoo GET    /admin/tattoos/new(.:format)                   {:action=&gt;&quot;new&quot;, :controller=&gt;&quot;admin/tattoos&quot;}
           edit_admin_tattoo GET    /admin/tattoos/:id/edit(.:format)              {:action=&gt;&quot;edit&quot;, :controller=&gt;&quot;admin/tattoos&quot;}
                admin_tattoo GET    /admin/tattoos/:id(.:format)                   {:action=&gt;&quot;show&quot;, :controller=&gt;&quot;admin/tattoos&quot;}
                             PUT    /admin/tattoos/:id(.:format)                   {:action=&gt;&quot;update&quot;, :controller=&gt;&quot;admin/tattoos&quot;}
                             DELETE /admin/tattoos/:id(.:format)                   {:action=&gt;&quot;destroy&quot;, :controller=&gt;&quot;admin/tattoos&quot;}
                      submit GET    /submit(.:format)                              {:controller=&gt;&quot;index&quot;, :action=&gt;&quot;new&quot;}
                             POST   /submit(.:format)                              {:controller=&gt;&quot;index&quot;, :action=&gt;&quot;create&quot;}
                      tattoo GET    /tattoo/:id(.:format)                          {:controller=&gt;&quot;index&quot;, :action=&gt;&quot;show&quot;}
                      tagged GET    /tagged(.:format)                              {:controller=&gt;&quot;index&quot;, :action=&gt;&quot;tagged&quot;}
                             DELETE /tattoo/:id(.:format)                          {:controller=&gt;&quot;index&quot;, :action=&gt;&quot;destroy&quot;}
                     tattoos GET    /tattoos(.:format)                             {:controller=&gt;&quot;index&quot;, :action=&gt;&quot;index&quot;}
  </code></pre>
  <p>Now, the problems Im having are stuff like, if I try to post new tattoos as a user(which is part of my nested resources) I am somehow routed to <strong>/tattoos</strong> (in my index controller) when I try to create the record, where I should be routed to <strong>members/member_id/tattoos.</strong> And if I remove that one line in my routes (<strong>match &quot;/tattoos&quot; =&gt; &quot;index#index&quot;, :via =&gt; :get, :as =&gt; &quot;tattoos</strong>) and try to go to <strong>/members/member_id/tattoos/new</strong> I get the follow error:</p>
  <p>No route matches &quot;/tattoos&quot;</p>
  <p>In fact, if I try to upload new photos from the /submit page I also get that error?</p>
  <p>What gives? My routes are totally whack!</p>
  <h2>Requested Form code and controller code for good measure</h2>
  <pre><code>    -- Forms:
      &lt;div class=&quot;content&quot;&gt;
        &lt;%= form_for @tattoo, :html =&gt;{:multipart =&gt; true} do |f| %&gt;
         &lt;ol&gt;
            &lt;li&gt; blah blah blah
  
  --members&gt;tattoos_controller
  class TattoosController &lt; ApplicationController
  
    def new
      @tattoo = Tattoo.new
    end
  
    def create
      @tattoo = Tattoo.new(params[:image])
  
      if @tattoo.save
        flash[:success] = &quot;Tattoo sent in for approval!&quot;
        redirect_to(member_tattoos_path(current_user, @tattoo))
        else
        render :action =&gt; &quot;new&quot;
      end
    end
  
  class IndexController &lt; ApplicationController
  
    def new
      @tattoo =Tattoo.new
    end
  
    def create
      @tattoo =Tattoo.new(params[:image])
  
      if @tattoo.save
        flash[:success] = &quot;Tattoo sent in for approval!&quot;
        redirect_to(tattoos_path)
        else
        render :action =&gt; &quot;new&quot;
      end
    end
  </code></pre>