2007-12-09 17:11:11 -05:00
|
|
|
module ActionView
|
|
|
|
module TemplateHandlers
|
|
|
|
class Builder < TemplateHandler
|
2008-01-21 20:46:34 -05:00
|
|
|
include Compilable
|
|
|
|
|
2009-05-21 17:22:07 -04:00
|
|
|
self.default_format = Mime::XML
|
|
|
|
|
2007-12-09 17:11:11 -05:00
|
|
|
def compile(template)
|
2009-09-13 23:55:46 -04:00
|
|
|
require 'active_support/vendor/builder'
|
2009-06-17 19:23:11 -04:00
|
|
|
"xml = ::Builder::XmlMarkup.new(:indent => 2);" +
|
2008-07-15 15:41:38 -04:00
|
|
|
"self.output_buffer = xml.target!;" +
|
2008-06-02 16:32:58 -04:00
|
|
|
template.source +
|
2008-07-05 18:31:57 -04:00
|
|
|
";xml.target!;"
|
2007-12-09 17:11:11 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|