14
我有一個嵌套的資源附件,我想創建一個link_to
銷燬/刪除附件。這裏是我的東西,但它發佈爲GET與PUT:Rails link_to銷燬一個嵌套的資源?
<%= 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" %>
想法?謝謝!
很感謝,但我只是檢查了日誌,它仍在做GET – AnApprentice 2011-02-09 01:42:08
這很奇怪。你嘗試翻轉:方法和:確認周圍?哪個日誌在GET請求中顯示?在調用中是否看到名爲_method的參數? – 2011-02-09 01:57:26