【发布时间】:2017-11-17 22:45:55
【问题描述】:
我想删除名称后的空格并使用 HAML 完成最终的 HTML: 约翰,首席执行官
%p.about_title_bx
= truncate about.name,length:100
, #{truncate about.position,length:100}
【问题讨论】:
标签: haml
我想删除名称后的空格并使用 HAML 完成最终的 HTML: 约翰,首席执行官
%p.about_title_bx
= truncate about.name,length:100
, #{truncate about.position,length:100}
【问题讨论】:
标签: haml
您可以添加< 以删除空格:
%p.about_title_bx<
= truncate about.name,length:100
, #{truncate about.position,length:100}
另外,请记住,HAML 应该有助于结构,而不是内容。使用辅助方法或内联该内容可能是更好的解决方案。
【讨论】: