Validating HTTP(S) URLs in Ruby on Rails
Regular expressions are not a great way to validate URLs. Using Ruby’s built-in
URI parser, a custom Active Record Validation Helper can be built to safely
validate URLs in Ruby on Rails applications while allowing for flexible domain name
allow-listing.
read more