我最近升级到了Rails 3.1(从3.0开始),出于某种原因,我的一条路由不再工作。我有一个表单发布csv文件,并由项目控制器处理。路线如下:Rails 3.1路由 - 集合不起作用
resources :items do
member do
post 'receive'
post 'show'
end
collection do
post 'csv_import'
get 'transactions'
get 'template'
end
end
而这里是我在日志中看到的 - 它看起来像是发布了正确的操作。
Started POST "/items/csv_import" for 127.0.0.1 at Tue May 08 11:09:52 -0400 2012
Processing by ItemsController#show as HTML
但它正在由show动作处理:
ActiveRecord::RecordNotFound in ItemsController#show
Couldn't find Item with id=csv_import
我不能为我的生命看到我在做什么错在这里。
什么'rake routes'不得不说? –