6873fc8026
Upgraded to Rails 2.0.2, except that we maintain vendor/rails/actionpack/lib/action_controller/routing.rb from Rail 1.2.6 (at least for now), so that Routes don't change. We still get to enjoy Rails's many new features. Also fixed a bug in Chunk-handling: disable WikiWord processing in tags (for real this time).
20 lines
490 B
Ruby
20 lines
490 B
Ruby
require 'builder'
|
|
|
|
module ActionView
|
|
module TemplateHandlers
|
|
class Builder < TemplateHandler
|
|
def self.line_offset
|
|
2
|
|
end
|
|
|
|
def compile(template)
|
|
content_type_handler = (@view.send!(:controller).respond_to?(:response) ? "controller.response" : "controller")
|
|
"#{content_type_handler}.content_type ||= Mime::XML\n" +
|
|
"xml = Builder::XmlMarkup.new(:indent => 2)\n" +
|
|
template +
|
|
"\nxml.target!\n"
|
|
end
|
|
end
|
|
end
|
|
end
|