【发布时间】:2012-05-10 00:12:17
【问题描述】:
使用 Rails 3.2 我在 config/routes.rb 中有以下内容
scope "/:locale" do
resource :users, :only => [:new, :create]
namespace :admin do
resources :specifications
end
end
用户路线按预期工作,规范路线工作,除了索引。通过 GET 调用“/en/admin/specifications”会返回以下错误:
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">}
我做错了什么?
【问题讨论】:
标签: ruby-on-rails namespaces scope url-routing