From cf2ee1451baca9c1c1ec00f221ce5a2fbefaa41f Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 15 Oct 2007 20:30:48 +0000 Subject: Fix silent failure of rxml templates. Closes #9879. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7921 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/base.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/base.rb') 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" -- cgit v1.2.3