module SanitizeHtmlFields::ClassMethods

Public Instance Methods

sanitize_html_fields(options = {}) click to toggle source
# File lib/sanitize_html_fields/sanitize_html_fields.rb, line 10
def sanitize_html_fields(options = {})
  send :include, InstanceMethods
  send :before_save, :convert_html_fields

  cattr_accessor :shf_convert_newlines
  self.shf_convert_newlines = options.delete(:convert_newlines) || false

  cattr_accessor :shf_remove_excessive_whitespaces
  self.shf_remove_excessive_whitespaces = options.delete(:remove_excessive_whitespaces) || true

  cattr_accessor :shf_options
  self.shf_options = options
end