【发布时间】:2011-05-26 04:44:00
【问题描述】:
我在 routes.rb 中有以下内容:
resource :account, :controller => "accounts"
resources :accounts
此重定向在控制器中:
redirect_to account_url
当调用此重定向时,我收到以下错误:
路由错误
没有路由匹配 {:action=>"destroy", :controller=>"accounts"}
运行rake routes时显示如下:
...
...
帐户删除 /accounts(.:format) {:action=>"destroy", :controller=>"accounts"}
...
...
帐户删除 /accounts/:id(.:format) {:action=>"destroy", :controller=>"accounts"}
...
...
所以在我看来,我已经得到了 {:action=>"destroy", :controller=>"accounts"} -> 根据 rake routes 反正。有人知道我做错了什么吗?
【问题讨论】:
标签: ruby-on-rails-3