aboutsummaryrefslogblamecommitdiffstats
path: root/actionpack/lib/action_view/template_handlers/builder.rb
blob: 7d24a5c423a9426ba619ed100d858c86f0a80171 (plain) (tree)
1
2
3
4
5
6
7
8
9




                                   

                        
                           
                                                   
                                                           
                                               
                           
                         



         
require 'builder'

module ActionView
  module TemplateHandlers
    class Builder < TemplateHandler
      include Compilable

      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
    end
  end
end