I am trying to create a validation that checks to make sure a domain/url is valid for example \"test.com\"
def valid_domain_name? domain_name = domain.spli
Using Brian Ray's answer above which I think answers the question (domain not url) and updating it for Rails 4.
/\A[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}\z/ix