aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-04-27 12:34:25 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-04-27 12:34:25 -0700
commitab83db9d069dea643eeb3588eeee634a780b6735 (patch)
treeb88a52903ff5e3fefe2a813c21d8da3f36403013 /actionmailer/lib
parentcecafc52ee0a4a53c903ddbaba95683261f88e5f (diff)
downloadrails-ab83db9d069dea643eeb3588eeee634a780b6735.tar.gz
rails-ab83db9d069dea643eeb3588eeee634a780b6735.tar.bz2
rails-ab83db9d069dea643eeb3588eeee634a780b6735.zip
Fixes ActionMailer to work with the ActionView refactoring
Diffstat (limited to 'actionmailer/lib')
-rw-r--r--actionmailer/lib/action_mailer/base.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index 69e77871b0..af2cc2ee24 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -475,7 +475,7 @@ module ActionMailer #:nodoc:
# if @parts.empty?
template_root.find_all_by_parts(@template, {}, template_path).each do |template|
@parts << Part.new(
- :content_type => Mime::Type.lookup_by_extension(template.content_type || "text").to_s,
+ :content_type => template.mime_type ? template.mime_type.to_s : "text/plain",
:disposition => "inline",
:charset => charset,
:body => render_template(template, @body)
@@ -555,12 +555,13 @@ module ActionMailer #:nodoc:
end
def render_template(template, body)
- if template.respond_to?(:content_type)
- @current_template_content_type = template.content_type
+ if template.respond_to?(:mime_type)
+ @current_template_content_type = template.mime_type && template.mime_type.to_sym.to_s
end
@template = initialize_template_class(body)
- layout = _pick_layout(layout, true) unless template.exempt_from_layout?
+ layout = _pick_layout(layout, true) unless
+ ActionController::Base.exempt_from_layout.include?(template.handler)
@template._render_template_with_layout(template, layout, {})
ensure
@current_template_content_type = nil
@@ -584,7 +585,7 @@ module ActionMailer #:nodoc:
end
layout = _pick_layout(layout,
- !template || !template.exempt_from_layout?)
+ !template || ActionController::Base.exempt_from_layout.include?(template.handler))
if template
@template._render_template_with_layout(template, layout, opts)