Class: ActionView::TemplateHandlers::Builder

Inherits:
ActionView::TemplateHandler show all
Includes:
Compilable
Defined in:
lib/action_view/template_handlers/builder.rb

Instance Method Summary collapse

Methods included from Compilable

included

Methods inherited from ActionView::TemplateHandler

call, #initialize, #render

Constructor Details

This class inherits a constructor from ActionView::TemplateHandler

Instance Method Details

#compile(template) ⇒ Object


8
9
10
11
12
13
14
# File 'lib/action_view/template_handlers/builder.rb', line 8

def compile(template)
  "_set_controller_content_type(Mime::XML);" +
    "xml = ::Builder::XmlMarkup.new(:indent => 2);" +
    "self.output_buffer = xml.target!;" +
    template.source +
    ";xml.target!;"
end