title: I want to approve the comments made. Ruby On Rails
body: <p>I have an Approved column in a database which is false by default and might become true on &quot;Approve&quot; button click.</p>
  <p>That's what this button look like at the moment:</p>
  <pre class="lang-erb prettyprint-override"><code>&lt;%= link_to('Approve It', @comment_path, method: :update) %&gt;
  </code></pre>
  <p>But it raises an exception:</p>
  <blockquote>
  <p>No route matches [POST] &quot;/books/4/comments/6</p>
  </blockquote>
  <pre class="lang-ruby prettyprint-override"><code># app/controllers/comments_controller.rb
  def update
    @comment = Comment.find(params[:id])
    @comment.approve = true
  
    redirect_to '/dashboard'
  end
  </code></pre>
  <pre class="lang-ruby prettyprint-override"><code># config/routes.rb
  resources :books do
    resources :comments
  end
  </code></pre>
  <p>How can I fix it?</p>