Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用.erb,您可以这样做:
.erb
<%= some_func -%>
我想知道是否有类似的技术使用.haml.
.haml
= some_func
一种解决方案是使用以下命令显式删除额外的换行符chomp:
chomp
= some_func.chomp
可以完成任务的另一个功能是空格删除语法:
%div< = "test "
它返回以下 html:
<div>test</div>