There is a link with the method :delete :

 = link_to "Удалить", posts_path(@post), method: :delete 

However, the markup leaves the path /posts.6 , and not /posts/6 . Why?

  • If it's not difficult to run the rake routes command, what does its report look like? - cheops
  • one
    Paste the code as text, not images. - Nicolas Chabanovsky
  • ... all the same, only the last line is needed there, everything is already clear from it. - D-side

1 answer 1

Replace posts_path with post_path .

  • Thank you, it was just that I had written in the plural DELETE /posts/:id(.:format) posts#destroy - Andrei Shostik