I had a little problem creating the link.
My opinion:
<%= link_to 'slet', blog_comments_path(c.blog, c), :confirm => 'Er du sikker?', :method => :delete %>
Output:
http://localhost:3000/blogs/5/comments.6
Where should it be:
http://localhost:3000/blogs/5/comments/6
blog_comments_path is the route for all comments for the blog. if you want just a comment, you should use blog_comment_path (check with rake routes , I may be wrong in the syntax. But you understood this idea.)
blog_comments_path
blog_comment_path
rake routes
I think this shorter syntax will work:
<%= link_to 'slet', [c.blog, c], :confirm => 'Er du sikker?', :method => :delete %>
In my case, I had URLs like users.1 when I wanted users/1I had to add a line:resources :usersto routes.rb file
users.1
users/1
resources :users
Source: https://habr.com/ru/post/1395613/More articles:Problem with Nokia / Ovi cards - dynamic marker update - javascriptAre there trackers with Maven support? - mavenUnix merges more than two files - joinHow can I put a delay with C #? - functionPostGIS function to combine LINE geometry together? - functionProblems creating a Linux executable from C # source code using mkbundle - c #How to calculate things from many tables using multiple queries? - sqlShopify API - add to cart - phphow to use QWebPage in an application without a GUI - qtSQL Query Recursion for parent child relationship - sqlAll Articles