aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-02-25 19:33:50 -0800
committerJohn Hawthorn <john@hawthorn.email>2019-02-26 16:59:04 -0800
commitc2145462178d2b28135fac38ebbceeaadfa151df (patch)
treeebad7770e18f73949b1a75e32fdbaa5892d9f908 /actionmailer
parentff4b2cf2410286e75b2ad41c9733ef41f65fba15 (diff)
downloadrails-c2145462178d2b28135fac38ebbceeaadfa151df.tar.gz
rails-c2145462178d2b28135fac38ebbceeaadfa151df.tar.bz2
rails-c2145462178d2b28135fac38ebbceeaadfa151df.zip
Create templates with format=nil
Diffstat (limited to 'actionmailer')
-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 52360d40fe..8595b1e063 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -973,10 +973,11 @@ module ActionMailer
templates_name = headers[:template_name] || action_name
each_template(Array(templates_path), templates_name).map do |template|
- self.formats = [template.format]
+ format = template.format || self.formats.first
+ self.formats = [format]
{
body: render(template: template),
- content_type: template.type.to_s
+ content_type: Mime[format].to_s
}
end
end