title: Routing Error: No route matches [POST] "/topics/post_up_vote_path(post)"
body: <p>I'm working on an assignment for school and I'm receiving a routing error that I don't understand..  I'm trying to integrate a voting feature to allow users to up vote or down vote on various posts on the site.  However, I keep getting the following error:</p>
  
  <pre><code>Routing Error
  
  No route matches [POST] "/topics/post_up_vote_path(post)"
  </code></pre>
  
  <p>I recently updated my routes.rb file to look like this to implement shallow nesting:</p>
  
  <pre><code>Rails.application.routes.draw do
    devise_for :users
    resources :users, only: [:update]
  
    resources :topics do
      resources :posts, except: [:index]
    end
  
    resources :posts, only: [] do
      resources :comments, only: [:create, :destroy]
  
      post '/up-vote' =&gt; 'votes#up_vote', as: :up_vote
      post '/down-vote' =&gt; 'votes#down_vote', as: :down_vote
    end
  
    get 'about' =&gt; 'welcome#about'
  
    root to: 'welcome#index'
  end
  </code></pre>
  
  <p>Now my routes for up_votes and down_votes look like this:</p>
  
  <pre><code>post_up_vote_path POST /posts/:post_id/up-vote(.:format) votes#up_vote
  post_down_vote_path POST /posts/:post_id/down-vote(.:format) votes#down_vote
  </code></pre>
  
  <p>From the error I receive above it looks like my app is searching for /topics/post_up_vote_path(post) when it should be searching for /posts/:post_id/up-vote .  I'm a bit stuck at this point, not sure how to get things to route correctly..</p>
  
  <p>Here's the relevant GitHub branch associated with this project for further reference to other files:</p>
  
  <p><a href="https://github.com/jlquaccia/Bloccit/tree/checkpoint-49-voting" rel="nofollow">https://github.com/jlquaccia/Bloccit/tree/checkpoint-49-voting</a></p>