开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜