Sha256: b4cdfe957310367166b14cc6aedac2cb11a095f7d1ce0118cf5f8ec4f6eeecff
Contents?: true
Size: 261 Bytes
Versions: 6
Compression:
Stored size: 261 Bytes
Contents
class HtmlValidator < ActiveModel::EachValidator def validate_each(object, attribute, value) unless value =~ /^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/ object.errors[attribute] << (options[:message] || "is not formatted properly") end end end
Version data entries
6 entries across 6 versions & 1 rubygems