mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
This commit is contained in:
parent
fbd1e01bd6
commit
797de4d057
1 changed files with 3 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue