Advanced Rails Routing of short URL's and usernames off of root url
- by Michael Waxman
I want to have username URL's and Base 58 short URL's to resources both off of the root url like this:
http://mydomain.com/username #=> goes to given user
http://mydomain.com/a3x9 #=> goes to given story
I am aware of the possibilities of a user names conflicting with short urls, and I have a workaround, but what I can't figure out is the best way to set this up in rails.
Can I do it in rails routes?
Should I do something with a piece of Rack middleware?
Should I set up a routing controller?
Please let me know the best way to do this. Thanks so much!