In haml, I want to display 5 / 174
. numerator, foward slash, denominator.
= @numerator
/
= denominator
My workaround:
= @numerator
- slash = "/"
= slash
= denominator
I would just use interpolation with #{}
for something like this:
#{@numerator} / #{denominator}
(note you don’t need =
at the start).
If you really want to start a line in Haml with the /
character (or any other special character) you can escape it with \
e.g.
= @numerator
\/
= denominator
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With