Class: HtmlContent

Inherits:
String show all
Includes:
Mongoid::Fields::Serializable
Defined in:
lib/transit/support/html_content.rb

Overview

Subclasses String to provide custom functionality for html text content. When creating model attributes which will contain user created html text, assign the field type to HtmlContent.

Instance Method Summary collapse

Methods inherited from String

#to_slug

Instance Method Details

#deserialize(strval) ⇒ Object

Called on retrieval from the database.



21
22
23
# File 'lib/transit/support/html_content.rb', line 21

def deserialize(strval)
  self.replace strval
end

#serialize(strval) ⇒ Object

Called on save to the database.



28
29
30
# File 'lib/transit/support/html_content.rb', line 28

def serialize(strval)
  strval
end