Class: HoboFields::Types::Text

Inherits:
String
  • Object
show all
Defined in:
lib/hobo_fields/types/text.rb

Direct Known Subclasses

RawHtmlString, RawMarkdownString, TextileString

Constant Summary collapse

COLUMN_TYPE =
:text

Instance Method Summary collapse

Instance Method Details

#to_html(xmldoctype = true) ⇒ Object



8
9
10
# File 'lib/hobo_fields/types/text.rb', line 8

def to_html(xmldoctype = true)
  ERB::Util.html_escape(self).gsub("\n", "<br#{xmldoctype ? ' /' : ''}>\n").html_safe
end