ruby-on-rails – Link_to method incorrectly generates a route for a delete link

Question:

There is a link with the :delete method:

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

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

Answer:

Replace posts_path with post_path .

Scroll to Top