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)

  1. ex- http://www.example.com/gagan-gupta
  2. ex- http://www.example.com/gagan-gupta/about
  3. 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 

reference


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -