diff --git a/app/models/article.rb b/app/models/article.rb index 2a97e99..6899eac 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -724,8 +724,9 @@ class Article < ActiveRecord::Base paragraphs.empty? ? '' : paragraphs.first.to_html end - def lead - abstract.blank? ? first_paragraph.html_safe : abstract.html_safe + def lead(length = nil) + content = abstract.blank? ? first_paragraph.html_safe : abstract.html_safe + length.present? ? content.truncate(length) : content end def short_lead diff --git a/app/views/content_viewer/_article_title.html.erb b/app/views/content_viewer/_article_title.html.erb index 36eaea9..240b8b7 100644 --- a/app/views/content_viewer/_article_title.html.erb +++ b/app/views/content_viewer/_article_title.html.erb @@ -1,10 +1,10 @@ <% if @page.belongs_to_blog? || @page.belongs_to_forum?%>