Route help?


I'm trying to figure out how to do the route equivalent to URL-
rewriting such that is treated like a
REST get on (rather than id number).


Thanks much.

If this is the only model you ever plan to expose this way, you could try making that controller your root path, and then use FriendlyID or something else to make the connection.


I knew there was a route way to do this, and I found the simple way.

The last route in my routes.rb is now this:

match “*username”, :to =>“site#index”

And in my site controller’s index handler, I User.find_by_username(params[:username]) to know which user’s “site” I’m now a guest of.