From 797de4d057ff226e4e7d689da537472396bf6f86 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Sat, 18 Mar 2006 22:55:20 +0000 Subject: Use the full template file name for implicitly selected templates, instead of requiring AV to try to detect it (which is broken for this use case) (closes #4297) git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3955 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionmailer/lib/action_mailer/base.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 44aedddc5e..237e56ed0c 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -283,8 +283,9 @@ module ActionMailer templates = Dir.glob("#{template_path}/#{@template}.*") templates.each do |path| # TODO: don't hardcode rhtml|rxml - next unless md = /^([^\.]+)\.([^\.]+\.[^\+]+)\.(rhtml|rxml)$/.match(File.basename(path)) - template_name = "#{md.captures[0]}.#{md.captures[1]}" + basename = File.basename(path) + next unless md = /^([^\.]+)\.([^\.]+\.[^\+]+)\.(rhtml|rxml)$/.match(basename) + template_name = basename content_type = md.captures[1].gsub('.', '/') @parts << Part.new(:content_type => content_type, :disposition => "inline", :charset => charset, -- cgit v1.2.3