diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-07-11 11:14:59 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-07-11 11:14:59 -0500 |
commit | 68289693f723f7a11ab13014a784d0a95abfd6ed (patch) | |
tree | f095556b5124ac5c5432b8f389372446eae6202f /actionpack/lib/action_view/template_handlers/builder.rb | |
parent | 7d5c447d9c4ebebd921a90810ff7547f8e40ea38 (diff) | |
download | rails-68289693f723f7a11ab13014a784d0a95abfd6ed.tar.gz rails-68289693f723f7a11ab13014a784d0a95abfd6ed.tar.bz2 rails-68289693f723f7a11ab13014a784d0a95abfd6ed.zip |
Check for response in builder template since ActionMailer does not have one
Diffstat (limited to 'actionpack/lib/action_view/template_handlers/builder.rb')
-rw-r--r-- | actionpack/lib/action_view/template_handlers/builder.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/template_handlers/builder.rb b/actionpack/lib/action_view/template_handlers/builder.rb index 2d413490bd..cbe53e11d8 100644 --- a/actionpack/lib/action_view/template_handlers/builder.rb +++ b/actionpack/lib/action_view/template_handlers/builder.rb @@ -6,7 +6,8 @@ module ActionView include Compilable def compile(template) - "controller.response.content_type ||= Mime::XML;" + + # ActionMailer does not have a response + "controller.respond_to?(:response) && controller.response.content_type ||= Mime::XML;" + "xml = ::Builder::XmlMarkup.new(:indent => 2);" + template.source + ";xml.target!;" |