Module: Fustrate::Rails::Concerns::SanitizeHtml::ClassMethods

Defined in:
lib/fustrate/rails/concerns/sanitize_html.rb

Instance Method Summary collapse

Instance Method Details

#sanitize_html(*attributes, config) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/fustrate/rails/concerns/sanitize_html.rb', line 21

def sanitize_html(*attributes, config)
  before_validation do
    attributes.flatten.each do |attribute|
      next unless self[attribute]

      self[attribute] = ::Fustrate::Rails::Concerns::SanitizeHtml.sanitize(self[attribute], config)
    end
  end
end