What would be the best way to implement routes like github uses?
Ex:
github.com/about
github.com/37signals
github.com/javan
I’m guessing /about is a real controller, but the second and third probably load a user controller. What is the best way to do this?
Write a route like
match '/:id/' => 'user#show'for a user likejavanand have theshowaction in theusercontroller look up the user by username.So in the user controller:
You can learn more about routes here.