Class: Blocky::ContentBlock

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

Instance Method Summary collapse

Instance Method Details

#global?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'app/models/blocky/content_block.rb', line 8

def global?
  self.controller.nil? && self.action.nil?
end

#tidy_contentObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/models/blocky/content_block.rb', line 12

def tidy_content
  tidy = Tidy.new({
    doctype: "omit",
    indent: "auto",
    indent_spaces: 2,
    markup: true,
    output_xhtml: true,
    show_body_only: "yes",
    tab_size: 2,
    tidy_mark: false
  })
  self.content = tidy.clean(self.content.strip)
end