diff options
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/base.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 61b66add52..7bff8c00c2 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -572,7 +572,8 @@ module ActionView #:nodoc: if template_requires_setup?(extension) body = case extension.to_sym when :rxml, :builder - "controller.response.content_type ||= Mime::XML\n" + + content_type_handler = (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" |