I am wondering if there is some kind of built in function to strip the
text to given length, but I dont want to cut the word in the middle.
I know that this works, but it cuts the text.
<%= @post.body[0…60] %>
Is there a way to do the same thing but keep the last word as it is or
if the length of the word is longer than given size, strip the whole
word, not just the part of it.
I am wondering if there is some kind of built in function to strip the
text to given length, but I dont want to cut the word in the
middle.
I know that this works, but it cuts the text.
<%= @post.body[0…60] %>
Is there a way to do the same thing but keep the last word as it is or
if the length of the word is longer than given size, strip the whole
word, not just the part of it.