3
I’m using the function truncate
to show part of a text, next to this function I added the function html_safe
so that the text does not display unwanted characters. But when the text is greater than the limit I set, length: 150
, undesirable characters reappear.
I would like a solution for this, truncate the text but do not show unwanted characters.
<%= truncate(service.description.html_safe, length: 15, )
length: 150 or 15? You have one in the text and one in the code
– Pbras
The behavior is as expected. See: https://repl.it/repls/NovelPopularPercent What you need?
– vinibrsl