title: POST to route not working, despite route displaying in "rake routes"
body: <p>I have the following route, that appears in the list when I perform "rake routes":</p>
  
  <pre><code>         page_upload_image POST   /pages/:page_id/upload_image(.:format)                         pages#upload_image
  </code></pre>
  
  <p>I also have the following in my routes file:</p>
  
  <pre><code>resources :pages do
    post :sort, :on =&gt; :collection 
    post :upload_image, :on =&gt; :collection
  end
  </code></pre>
  
  <p>I'm then using JavaScript to capture and POST values pulled from the following:</p>
  
  <pre><code>%form.new-page-image{:class =&gt; "hide", :action =&gt; "/pages/#{@page.id}/upload_image"}
    %input.page_image{:type =&gt; "file", :name =&gt; "page[image]", :multiple =&gt; "true"}
  </code></pre>
  
  <p>I have the following for my upload_image action in my pages controller: </p>
  
  <pre><code>def upload_image
    image = params[:page][:image]
    uploader = PageImageUploader.new
    uploader.store!(image)
  
    render json: uploader.to_json
  end
  </code></pre>
  
  <p>For some reason, even though the route exists, when I post to it, I get the following:</p>
  
  <pre><code>ActionController::RoutingError (No route matches [POST] "/pages/1/upload_image"):
  </code></pre>
  
  <p>I'm wondering why a route, that appears legitimate (shows up properly when executing rake routes) would return this error when I try to post to it.</p>