Find your Rails subdomains

March 6th, 2008

No Gravatar

Need to find the subdomain of an incoming request? Recently I needed to determine the subdomain of an incoming request to properly format some search queries. 

@subdomain =request.subdomains.first

Leave a Reply