aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2006-03-18 22:55:20 +0000
committerJamis Buck <jamis@37signals.com>2006-03-18 22:55:20 +0000
commit797de4d057ff226e4e7d689da537472396bf6f86 (patch)
treec368a9f1ae34afdc245bbb1b493c1529b96afe21
parentfbd1e01bd6ca1b093811b0781d85f53850df12e3 (diff)
downloadrails-797de4d057ff226e4e7d689da537472396bf6f86.tar.gz
rails-797de4d057ff226e4e7d689da537472396bf6f86.tar.bz2
rails-797de4d057ff226e4e7d689da537472396bf6f86.zip
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
-rw-r--r--actionmailer/lib/action_mailer/base.rb5
1 files 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,