aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template/handlers/builder.rb
blob: a93cfca8aa8032a56c11ef51bf80a726e270973c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module ActionView
  module Template::Handlers
    class Builder < Template::Handler
      include Compilable

      self.default_format = Mime::XML

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