我有一个嵌套的资源附件,我想创建一个 link_to
销毁/删除附件。这是我所拥有的,但它以 GET 与 PUT 的形式发布:
<%= link_to "Delete Attachment", project_thread_attachment_path(@attachment.thread.project.id, @attachment.thread.id, @attachment.id), :confirm => "Are you sure you want to delete this attachment?", :method => :delete, :action => "destroy" %>
想法?谢谢!
最佳答案
尝试
link_to "Delete Attachment", [@attachment.thread.project,@attachment.thread,@attachment], :confirm => "Are you sure?", :method => :delete
它有效吗?
关于ruby-on-rails - Rails link_to 销毁嵌套资源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4940481/