5
在haml中,我想顯示5/174
。分子,前鋒斜線,分母。顯示haml中的正斜槓?
= @numerator
/
= denominator
我的解決方法:
= @numerator
- slash = "/"
= slash
= denominator
在haml中,我想顯示5/174
。分子,前鋒斜線,分母。顯示haml中的正斜槓?
= @numerator
/
= denominator
我的解決方法:
= @numerator
- slash = "/"
= slash
= denominator
我只想用interpolation with #{}
這樣的事情:
#{@numerator}/#{denominator}
(注意,您在一開始就不需要=
)。
如果你真的想用/
字符(或任何其他特殊字符)在Haml開始一行,你可以用escape it with \
= @numerator
\/
= denominator
\ /很好!謝謝! – sanemat