2
我發現當我使用users_path(user)
時,它返回/users.id
其中id是用戶的id,但我希望它返回/users/id
。我的配置routes.rb看起來像下面。users_path(用戶)在使用設計時返回/users.id而不是/ users/id
# config/routes.rb
Test::Application.routes.draw do
root to: "static_pages#home"
resources :users, only: [:index, :show]
devise_for :users
end