Module: Gluttonberg::Content::CleanHtml

Extended by:
ActiveSupport::Concern
Defined in:
lib/gluttonberg/content/clean_html.rb

Overview

This mixin provides helper methods which are used to clean html

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.setupObject



6
7
8
# File 'lib/gluttonberg/content/clean_html.rb', line 6

def self.setup
  ::ActiveRecord::Base.send :include, Gluttonberg::Content::CleanHtml
end

Instance Method Details

#clean_all_html_contentObject



63
64
65
66
67
68
69
# File 'lib/gluttonberg/content/clean_html.rb', line 63

def clean_all_html_content
  unless self.class.html_columns_list.blank?
    self.class.html_columns_list.each do |field|
      write_attribute(field , self.class.clean_tags(read_attribute(field)) )
    end
  end
end