Class: ContentElementText

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
ActsAsContentElement
Defined in:
app/models/content_element_text.rb

Overview

Schema Information

Table name: content_element_texts

 id                 :integer(4)      not null, primary key
 content_element_id :integer(4)
 text               :text
 created_at         :datetime
 updated_at         :datetime
 clean_text         :text

Instance Method Summary

Instance Method Details

- (Object) administration_partial

defines the path to the partial, that gets rendered in the body part of a content element in the backend custom content elements should have a method ‘administration_partial’ returning the specific partial



32
33
34
# File 'app/models/content_element_text.rb', line 32

def administration_partial
  "admin/content_elements/types/content_element_text/administration"
end

- (Object) create_clean_text



36
37
38
# File 'app/models/content_element_text.rb', line 36

def create_clean_text
  self.clean_text = self.text.gsub(/<\/?[^>]*>/, "") if self.text
end

- (Object) icon

returns the icon, that is used for the backend



26
27
28
# File 'app/models/content_element_text.rb', line 26

def icon
  "icons/content_elements/content_element_text.png"
end