0

我不明白为什么这个简单的路由现在不起作用。

下面的链接不起作用:它给出了routing error No route matches [DELETE] "/questions"

<%= link_to 'delete', @question, :method => :delete, :action => :destroy %>

rake routes节目

DELETE /questions/:id(.:format)                        questions#destroy

正确。

有谁可以找到这个错误的原因?

4

1 回答 1

1

尝试

<%= link_to 'delete', question_path(@question), :method => :delete, :confirm => "Are you sure?" %>
于 2013-01-23T09:43:36.560 回答