trimming the text....

check the ruby docs for String.

you could use scan or each or index and slice or split

so many choices.

raj wrote:

You might also want to check Rails TextHelper, which has some useful methods like excerpt, truncate, etc for manipulation strings.

http://api.rubyonrails.com/classes/ActionView/Helpers/TextHelper.html

- H