ruby - Remove controller_name from URL in Rails -
my url http://www.example.com/players/playersdetail/100006 have players controller. need remove or hide controller , method name (players/playersdetail) url , want name in place of id(100006)
- ex- http://www.example.com/gagan-gupta
- ex- http://www.example.com/gagan-gupta/about
- ex- https://www.facebook.com/gagan-gupta/friends
how achieve in ruby on rails?
routes is
something::application.routes.draw "players/search" post "players/search" "players/playerslist" "players/playersdetail" "players/list" "players/followers" "players/following" end
your::application.routes.draw scope ":name" '', to: 'players#show' :about, 'players#about' :friends, 'players#friends end end
Comments
Post a Comment