2

([DELETE] "/subscriptions" に一致するルートはありません)

使用して

<%= link_to 'Unsubscribe', subscriptions_path(feed_id: session[:read_random].last), method: :delete, remote: :true %>

ルート.rb:

resources :subscriptions

DELETE メソッドを使用して実際に /subscriptions/1 の URI を持つリンクが必要ですが、/subscriptions?feed_id=1 しか取得できないようです

4

1 に答える 1

3

削除する ID またはオブジェクトを指定してみてください。

<%= link_to 'Unsubscribe', subscription_path(session[:read_random].last), method: :delete, remote: :true %>
于 2012-06-15T04:15:00.330 に答える