使用 Rails 3.2,我在 config/routes.rb 中有以下内容
scope "/:locale" do
resource :users, :only => [:new, :create]
namespace :admin do
resources :specifications
end
end
用户路线按预期工作,规范路线工作,除了索引。通过对“/en/admin/specifications”的 GET 调用,将返回以下错误:
No route matches {:action=>"show", :controller=>"admin/specifications", :locale=>#<Specification id: 1, name: "Check-in", created_at: "2012-04-28 12:10:29", updated_at: "2012-04-28 12:10:29">}
我究竟做错了什么 ?