我有一个没有显示动作的控制器。
当前的销毁如下所示:
<td><%= link_to 'Destroy', subscriber, :confirm => 'Are you sure?', :method => :delete %></td>
我不希望它指向 {subscriber},因为该路由不存在。相反,我希望它指向订阅者索引
<td><%= link_to 'Destroy', subscribers_path, :confirm => 'Are you sure?', :method => :delete %></td>
但是,当我这样做时,我收到以下错误:
No route matches [DELETE] "/subscribers"
我在这里做错了什么?
更新:
这些是我的路线:
resources :subscribers
match 'subscribe' => 'Subscribers#subscribe'
match 'unsubscribe' => 'Subscribers#unsubscribe'