Class: TextBlock
Overview
Defines a plain block of html based content to be output directly to the page. Typically used with wysiwyg editors etc.
Instance Method Summary (collapse)
- - (Object) as_json(options = {})
-
- (Object) deliver
Contexts are delivered either internally or via helper method.
Methods inherited from Context
#context_type, #set_default_position
Instance Method Details
- (Object) as_json(options = {})
25 26 27 28 |
# File 'app/models/contexts/text_block.rb', line 25 def as_json( = {}) .merge!({ :only => [:body] }) super() end |
- (Object) deliver
Contexts are delivered either internally or via helper method. If the deliver method exists on a resource, it is used. In this case, text blocks always simply deliver their content.
21 22 23 |
# File 'app/models/contexts/text_block.rb', line 21 def deliver self.body.to_s.html_safe end |