fix langs limit

This commit is contained in:
nccu 2015-02-06 18:02:08 +08:00
parent 1df28c21c1
commit da6fd75d2a
1 changed files with 9 additions and 1 deletions

View File

@ -134,9 +134,17 @@ class NewsController < ApplicationController
}
end
if I18n.locale.to_s == 'zh_tw'
subtitle = a.subtitle.truncate(100)
elsif I18n.locale.to_s == 'en'
subtitle = a.subtitle.truncate(200)
end
{
"title" => HTMLEntities.new.encode(a.title),
"subtitle" => a.subtitle.truncate(100),
"subtitle" => subtitle,
"statuses" => statuses,
"category" => a.category.title,
"postdate" => a.postdate,