class UrlNameValidator
zhe800 url_name validator
Constants
- REGEXP
Public Instance Methods
validate_each(record, attribute, value)
click to toggle source
# File lib/validations/url_name_validator.rb, line 4 def validate_each(record, attribute, value) record.errors.add attribute, (options[:message] || I18n.t('rails_validation.url_name.invalid')) unless value =~ REGEXP end