mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
17 lines
396 B
Ruby
17 lines
396 B
Ruby
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
|