在我的布局文件中,我有一个表示感谢的content_for标签。我想让首席执行官和萨利设计团队以及快乐设计团队之间的界限有所突破。怎么做?在使用< br/>时,我会得到语法错误。
layout.html.erb
<p class="no-margin" style="padding:10px 0 0;">
<%= content_for?(:thanking) ? 'CEO,' ' The Sadly Design Team' : "Sincerely, 'The Happy design team " %>
</p>发布于 2014-11-10 13:53:38
你可以这样做:
<%= (content_for?(:thanking) ? "CEO,<br/>The Sadly Design Team" : "Sincerely,<br/>The Happy design team").html_safe %>发布于 2014-11-10 13:57:44
试试这个:
<% if content_for?(:thanking) %>
CEO,<br>
The Sadly Design Team
<% else %>
Sincerely,<br>
The Happy design team
<% end %>https://stackoverflow.com/questions/26845017
复制相似问题