SubdomainFu: Tame sub domains in your Rails apps
SubdomainFu is a plugin developed by Michael Bleigh of Intridea that allows you to easily deal with subdomains in your Rails applications.
Not just a superficial hack, SubdomainFu even extends the Rails routing system to allow you to specify subdomains within routes. Example:
url_for(:controller => "my_controller", :action => "my_action", :subdomain => "awesome") # => http://awesome.intridea.com/my_controller/my_action users_url(:subdomain => false) # => http://intridea.com/users # The full URL will be generated if the subdomain is not the same as the # current subdomain, regardless of whether _path or _url is used. users_path(:subdomain => "fun") # => http://fun.intridea.com/users users_path(:subdomain => false) # => /users