add subtitle word limit

This commit is contained in:
nccu 2015-01-30 11:10:58 +08:00
parent ffbc10f6ef
commit 1df28c21c1
1 changed files with 2 additions and 1 deletions

View File

@ -133,9 +133,10 @@ class NewsController < ApplicationController
"status-class" => "status-#{status['classname']}" "status-class" => "status-#{status['classname']}"
} }
end end
{ {
"title" => HTMLEntities.new.encode(a.title), "title" => HTMLEntities.new.encode(a.title),
"subtitle" => a.subtitle, "subtitle" => a.subtitle.truncate(100),
"statuses" => statuses, "statuses" => statuses,
"category" => a.category.title, "category" => a.category.title,
"postdate" => a.postdate, "postdate" => a.postdate,