Call Montréal, Canada 524-949-6869

Blog

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.

Developing Ruby on Rails applications and Radiant-based Content Management Systems in Montréal. Contact Firsthand.