| Module | ActiveModel::Validations::ClassMethods |
| In: |
lib/validate_url.rb
|
Validates whether the value of the specified attribute is valid url.
class Unicorn
include ActiveModel::Validations
attr_accessor :homepage, :ftpsite
validates_url :homepage, allow_blank: true
validates_url :ftpsite, schemes: ['ftp']
end
Configuration options: