我在路线中有以下声明:
resource :users, :only => [:index, :show, :update, :destroy] do
get "users/dashboard"
end
但是,当我做 rake 路线时,我得到了:
dashboard_users GET /users/users/dashboard(.:format) users/users#dashboard
users GET /users(.:format) users#show
PUT /users(.:format) users#update
DELETE /users(.:format) users#destroy
请注意,users_path 被错误地映射到 users#show。我期待:
users GET /users/:id/(.:format) users#show
什么可能导致此问题以及如何解决?