Module: ActiveModel::Validations::HelperMethods

Defined in:
lib/strip-tags.rb

Instance Method Summary collapse

Instance Method Details

#strip_tags(options = {}) ⇒ Object

Strips tags from model fields.



6
7
8
9
10
11
12
# File 'lib/strip-tags.rb', line 6

def strip_tags(options = {})
  StripTags.validate_options(options)

  before_validation(options.slice(:if, :unless)) do |record|
    StripTags.strip(record, options)
  end
end