0
我試圖改變users
模型的控制器和routing.rb
的動作,當時指向/users
url。這裏是我試圖改變它:如何在rails的根目錄下更改模型的默認路由?
resources :users, only: :show do
get 'favorites' => 'routers#client'
get 'tours' => 'routers#client'
get 'offers' => 'routers#client'
get 'open_houses' => 'routers#client'
get 'searches'
end
get 'users/:id' => 'routers#client'
的favorties
,tours
,offers
和open_houses
路線routers_controller
client
行動時,URL,例如/users/:id/favorites
等被調用。但是當撥打/user/:id
時,它不會映射到routers
控制器。我應該如何改變這個控制器的索引路線?
不起作用... –