我想用空格分隔货币和总额。
请给我一个解决方案任何帮助将不胜感激。
p
strong Total:
span
= @order.currency
= humanized_money_with_symbol @order.total_paisas/100
您可以通过字符串插值解决此问题,方法如下:
p
strong Total:
span
= "#{@order.currency} #{humanized_money_with_symbol @order.total_paisas/100}"
或者像这样的非破坏性空间:
p
strong Total:
span
= @order.currency
|
= humanized_money_with_symbol @order.total_paisas/100
你也可以使用Slim输出=>
或=<
https://github.com/slim-template/slim#output-
在第一个输出上使用尾随空格
p
strong Total:
span
=> @order.currency
= humanized_money_with_symbol @order.total_paisas/100
或在第二个输出上使用前导空格
p
strong Total:
span
= @order.currency
=< humanized_money_with_symbol @order.total_paisas/100
另外一个选项:
p
strong Total:
span
= [@order.currency, humanized_money_with_symbol @order.total_paisas/100].join(' ')