method
extract_domain
v7.0.0 -
Show latest stable
- Class:
ActionDispatch::Http::URL
extract_domain(host, tld_length)public
Returns the domain part of a host given the domain level.
# Top-level domain example extract_domain('www.example.com', 1) # => "example.com" # Second-level domain example extract_domain('dev.www.example.co.uk', 2) # => "example.co.uk"