如何在我的ERB标签中添加<br/>?

时间:2017-07-26 13:53:52

标签: ruby-on-rails

我有一个看起来像这样的按钮: button as it looks in the browser

按钮的代码是:

&#13;
&#13;
<%=  mail_to "example@email.com", 'Request more info about holiday extensions here', Subject: "Hi Please include your name and email address", class: 'button-email' %>
&#13;
&#13;
&#13;

如何添加br标签,以便按钮文本显示在2行上,从&#34; 关于&#34;

请求更多信息

HOLIDAY EXTENSIONS HERE

提前致谢!

2 个答案:

答案 0 :(得分:4)

mail_to可以采取阻止,所以:

<%=  mail_to "example@email.com", subject: "Hi Please include your name", class: 'button-email' do
  <span>Request more info about</span> <br> <span>holiday extensions here</span>
 end %>

你不需要span标签,但是如果你想用颜色/ embolden来设置它们,你可以。

答案 1 :(得分:3)

Ruby on Rails 中你可以这样做:

<%=  mail_to "example@email.com", "Request more info about <br />holiday extensions here".html_safe, Subject: "Hi Please include your name and email address", class: 'button-email' %>