是否可以引用app/controllers/admin/categories_controller.rb
usingcategories_path
而不是admin_categories_path
?
我正在使用 Rails 4。
# app/controllers/admin
class Admin::CategoriesController < Admin::BaseController
end
# visiting localhost:3000/admin/categories causes route not found error 'admin/categories'
scope module: "admin" do
resources :categories
end
# visiting localhost:3000/admin/categories causes uninitialized constant CategoriesController
scope "/admin" do
resources :categories
end