Module: SubdomainRoutes

Defined in:
lib/subdomain_routes/routes.rb,
lib/subdomain_routes/mapper.rb,
lib/subdomain_routes/config.rb,
lib/subdomain_routes/request.rb,
lib/subdomain_routes/resources.rb,
lib/subdomain_routes/assertions.rb,
lib/subdomain_routes/url_writer.rb,
lib/subdomain_routes/split_host.rb,
lib/subdomain_routes/validations.rb

Defined Under Namespace

Modules: Config, Request, Resources, RewriteSubdomainOptions, Routing, RoutingAssertions, SplitHost, UrlRewriter, UrlWriter, Validations Classes: HostNotSupplied, TooManySubdomains

Class Method Summary collapse

Class Method Details

.valid_subdomain?(subdomain) ⇒ Boolean



2
3
4
# File 'lib/subdomain_routes/validations.rb', line 2

def self.valid_subdomain?(subdomain)
  subdomain.to_s =~ /^([a-z]|[a-z][a-z0-9]|[a-z]([a-z0-9]|\-[a-z0-9])*)$/
end