All things Ruby on Rails, Content Management Systems and Web Development
Monday, December 6, 2010
Truncate HTML in Rails
After a bit of searching for a truncation helper for HTML, I found this great gem: truncate_html. It maintains the HTML tags (i.e doesn't strip them out) and supports word boundaries. Nice! Oh, and supports Rails 2.x and 3.x.