Skip to content

Instantly share code, notes, and snippets.

@xdite
Created July 8, 2013 10:00
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save xdite/5947620 to your computer and use it in GitHub Desktop.
Save xdite/5947620 to your computer and use it in GitHub Desktop.
# -*- encoding : utf-8 -*-
class Subdomain
def self.matches?(request)
case request.host
when Setting.host, "www.#{Setting.host}", nil
false
else
true
end
end
end
constraints(Subdomain) do
get '/' => 'posts#index'
resources :posts do
collection do
get :search
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment