Method: BaseHelper#excerpt_with_jump
- Defined in:
- app/helpers/base_helper.rb
#excerpt_with_jump(text, end_string = ' ...') ⇒ Object
101 102 103 104 105 106 107 108 109 110 |
# File 'app/helpers/base_helper.rb', line 101 def excerpt_with_jump(text, end_string = ' ...') return if text.blank? doc = Hpricot( text ) paragraph = doc.at("p") if paragraph paragraph.to_html + end_string else truncate_words(text, 150, end_string) end end |