title: The action 'destroy' could not be found for ActivitiesController despite being defined
body: <p>For some reason I am getting error "The action 'destroy' could not be found for ActivitiesController" when trying to destroy an object: </p>
  
  <p>view: </p>
  
  <pre><code>&lt;% @activities.each do |a|%&gt;
  ...
  
    &lt;td&gt;&lt;%= link_to 'Delete', activity_path(a.id), method: :delete, data: {confirm: "Are you    sure?"} %&gt;&lt;/td&gt;
  ...
  
  &lt;% end %&gt;
  </code></pre>
  
  <p>controller: </p>
  
  <pre><code>def destroy
    @activity = Activity.find(params[:id])
    @activity.destroy
    redirect_to activity_path
  end
  </code></pre>
  
  <p>What could be the issue? </p>
  
  <p>ruby: 2.6.3p62
  Rails: 6.0.2.1</p>