Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从 URL 中删除 slug 名称?我有父页面的 URL:
host_url/home/index
但我需要这样
host_url/index #without parent slug name
您可以简单地更改routes为:
routes
match '/index', :to => 'home#index', via: [:get]
如果resources在routes.
resources
resources :users, path: '/' get '/index' => 'home#index'