This could also be `validates_format_of :url, with: ...` (this is a personal preference, though the version you've used is often cleaner if you're applying multiple validators to the same attribute)