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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -