Please read for an updated status on RailsCasts:
Learn more or hide this
GitHub User: rzane
Don't forget .includes(:owner, :trackable)
I use request.subdomains.first rather than request.subdomain as recommended by DHH: http://37signals.com/svn/posts/1512-how-to-do-basecamp-style-subdomains-in-rails
If you use request.subdomain and use an IP address as the URL, request.subdomain will include the IP address.