[英]link_to destroy using resources route in rails
(沒有路由匹配[DELETE]“/ subscriptions”)
運用
<%= link_to 'Unsubscribe', subscriptions_path(feed_id: session[:read_random].last), method: :delete, remote: :true %>
routes.rb中:
resources :subscriptions
我需要使用DELETE方法實際擁有/ subscriptions / 1 URI的鏈接,但我似乎只能獲得/訂閱?feed_id = 1
嘗試指定要刪除的id或對象:
<%= link_to 'Unsubscribe', subscription_path(session[:read_random].last), method: :delete, remote: :true %>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.