Hey, 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. Thank you. P. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

