我的网址是 http://www.example.com/players/playersdetail/100006 我有一个播放器控制器。我需要从 url 中删除或隐藏控制器和方法名称(players/playersdetail),我想用名称代替 id(100006)
- 前http://www.example.com/gagan-gupta
- 前http://www.example.com/gagan-gupta/about
- 前https://www.facebook.com/gagan-gupta/friends
如何在 Ruby On Rails 中实现?
路线是
Something::Application.routes.draw do
get "players/search"
post "players/search"
get "players/playerslist"
get "players/playersdetail"
get "players/list"
get "players/followers"
get "players/following"
end