Skip to content

Instantly share code, notes, and snippets.

@misza222
Created February 13, 2011 15:07
Show Gist options
  • Save misza222/824746 to your computer and use it in GitHub Desktop.
Save misza222/824746 to your computer and use it in GitHub Desktop.
class ShopRoutesConstraint
def self.matches?(request)
! ADMIN_DOMAIN_NAMES.include?(request.host)
end
end
class AdminRoutesConstraint
def self.matches?(request)
ADMIN_DOMAIN_NAMES.include?(request.host)
end
end
Takeaway::Application.routes.draw do
constraints(AdminRoutesConstraint) do
devise_for :shop_admins
end
constraints(ShopRoutesConstraint) do
devise_for :clients
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment