Class: ActionView::Template::Handlers::Builder

Inherits:
ActionView::Template::Handler 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::Template::Handler

call, #render

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)
  require 'builder'
  "xml = ::Builder::XmlMarkup.new(:indent => 2);" +
    "self.output_buffer = xml.target!;" +
    template.source +
    ";xml.target!;"
end