I am having a small problem creating a link.
My view:
<%= link_to 'slet', blog_comments_path(c.blog, c), :confirm => 'Er du sikker?', :method => :delete %>
Output:
http://localhost:3000/blogs/5/comments.6
Where it should by:
http://localhost:3000/blogs/5/comments/6
blog_comments_path
is the route for all comments for a blog. if you want just a comment, you have to use blog_comment_path
(check with rake routes
, I might be wrong with the syntax. But you get the idea.)
Had the same problem, because in my routes I had
resource :products
and not
resources :products
Don't forget the plural ;)
And always check your routes :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With