Class: ContentBlock

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
FriendlyId
Defined in:
app/models/content_block.rb

Overview

Belongs to a Page. A chunk of presentable content, either made up of plain text or HTML.

Instance Method Summary collapse

Instance Method Details

#renderString

Returns a string of plain text or render-safe HTML.

Returns:

  • (String)

    a string of plain text or render-safe HTML.



15
16
17
18
19
20
21
# File 'app/models/content_block.rb', line 15

def render
  if allow_html
    content.html_safe
  else
    content
  end
end