diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-15 20:30:48 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-15 20:30:48 +0000 |
commit | cf2ee1451baca9c1c1ec00f221ce5a2fbefaa41f (patch) | |
tree | 9a2d8b18dead54cd0849b8b9b2609805800c6a47 /actionpack/lib | |
parent | ea1eafb6b10dc4c392b18b0990111d48e74e7ba5 (diff) | |
download | rails-cf2ee1451baca9c1c1ec00f221ce5a2fbefaa41f.tar.gz rails-cf2ee1451baca9c1c1ec00f221ce5a2fbefaa41f.tar.bz2 rails-cf2ee1451baca9c1c1ec00f221ce5a2fbefaa41f.zip |
Fix silent failure of rxml templates. Closes #9879.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7921 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-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" |