How to get a line break in a plain text email RoR?

2020-07-07 01:38发布

I'm sending a plain text email and was wondering how I add a line break to this. It's showing up on on the same line.

From: <%= @name %>
<%= @text %>

Thanks

3条回答
男人必须洒脱
2楼-- · 2020-07-07 01:45
\r\n

or if you're sending html email:

<br />

so:

From: <%= @name %> \r\n <%= @text %>
From: <%= @name %> <br /> <%= @text %>
查看更多
狗以群分
3楼-- · 2020-07-07 01:52

I could be completely wrong, but isn't it a simple \n ?

查看更多
在下西门庆
4楼-- · 2020-07-07 02:02
<%= "\r\n" %>

In double quotes and inside '<% %>'.

Otherwise it's considered as simple text.

查看更多
登录 后发表回答