Render category descriptions differently on the categories page

This commit is contained in:
Neil Lalonde
2013-06-14 11:18:27 -04:00
parent bd1b4d3130
commit f62c421c91
5 changed files with 41 additions and 22 deletions

View File

@@ -10,6 +10,7 @@ class CategoryDetailedSerializer < ApplicationSerializer
:topics_month,
:topics_year,
:description,
:description_excerpt,
:is_uncategorized
has_many :featured_users, serializer: BasicUserSerializer
@@ -39,4 +40,8 @@ class CategoryDetailedSerializer < ApplicationSerializer
return displayable_topics.present?
end
def description_excerpt
PrettyText.excerpt(description,300) if description
end
end