Module: TruncateHtmlHelper

Defined in:
lib/app/helpers/truncate_html_helper.rb

Instance Method Summary collapse

Instance Method Details

#truncate_html(html, options = {}) ⇒ Object


3
4
5
6
7
# File 'lib/app/helpers/truncate_html_helper.rb', line 3

def truncate_html(html, options={})
  return '' if html.nil?
  html_string = TruncateHtml::HtmlString.new(html)
  TruncateHtml::HtmlTruncator.new(html_string).truncate(options).html_safe
end