开发者

How to change mime type to text/html in rails 3?

开发者 https://www.devze.com 2023-02-05 03:17 出处:网络
Rails 3 defaults to Conten开发者_高级运维t-Type: text/plain I\'m trying to send and HTML email. How do I adjust the mime type?Just adding .html before the extension of your view template should work

Rails 3 defaults to Conten开发者_高级运维t-Type: text/plain

I'm trying to send and HTML email. How do I adjust the mime type?


Just adding .html before the extension of your view template should work.

app/views/user_mailer/welcome_email.html.erb


I assume you're talking about ActionMailer? Name your view files like this:

app/views/mailer_name/method_name.text.plain.erb
app/views/mailer_name/method_name.text.html.erb

Then, in text.plain, have a plain-text version of your HTML email.

0

精彩评论

暂无评论...
验证码 换一张
取 消