How can I use friendly URLs on my Rails application ? All I need is to make available the following url format
mysite.com/company1 mysite.com/user123 mysite.com/user1234 mysite.com/newton.garcia mysite.com/company-name
Can anyone help ?
How can I use friendly URLs on my Rails application ? All I need is to make available the following url format
mysite.com/company1 mysite.com/user123 mysite.com/user1234 mysite.com/newton.garcia mysite.com/company-name
Can anyone help ?
You can use a gem called SubDomain-Fu for this. Watch this screen cast for more details.
I already ask this question on Quora..
http://www.quora.com/How-does-Quora-rewrite-their-urls
For who really interested to implement Quora/Facebook URLs like. Heres a tip in Rails3:
Make a table called
slugs
:Now in routes.rb add this line to the bottom:
so, if we go to
/one
in the routes, it translated to be:Now in the
show
action in all controllers