Skip to content

Instantly share code, notes, and snippets.

@qhoxie
Created December 18, 2008 20:16
Show Gist options
  • Save qhoxie/37635 to your computer and use it in GitHub Desktop.
Save qhoxie/37635 to your computer and use it in GitHub Desktop.
match('/').defer_to do |request, params|
sd = request.subdomains.first.capitalize
if Object.const_defined? sd
redirect url(:controller => sd.downcase)
else
false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment