Ruby on rails Rails没有与之匹配的路由[删除]
正在尝试删除答复Ruby on rails Rails没有与之匹配的路由[删除],ruby-on-rails,database,oop,Ruby On Rails,Database,Oop,正在尝试删除答复 <% @comment.replies.each do |reply| %> <td><%= link_to 'Destroy', comment_replies_path(reply), method: :delete, data: { confirm: 'Are you sure?' }%></td> 耙道 comment_reply_path DELETE /comments/:comme
<% @comment.replies.each do |reply| %>
<td><%= link_to 'Destroy', comment_replies_path(reply), method: :delete, data: { confirm: 'Are you sure?' }%></td>
耙道
comment_reply_path
DELETE /comments/:comment_id/replies/:id(.:format) replies#destroy
我现在所在的url是
http://localhost:3000/comments/66/replies
routes.rb
resources :comments do
resources :replies
end
您的路线显示注释回复路径,您正在使用注释回复路径 您需要更新代码以使用正确的路径帮助器
<%= link_to 'Destroy', comment_reply_path(reply), method: :delete, data: { confirm: 'Are you sure?' }%>
你的路线是什么。rb?@SebastianPalma updated我不知道怎么做你有这样的链接吗
<%= link_to 'Destroy', comment_reply_path(reply), method: :delete, data: { confirm: 'Are you sure?' }%>