fix langs limit
This commit is contained in:
parent
1df28c21c1
commit
da6fd75d2a
|
@ -134,9 +134,17 @@ class NewsController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
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),
|
"title" => HTMLEntities.new.encode(a.title),
|
||||||
"subtitle" => a.subtitle.truncate(100),
|
"subtitle" => subtitle,
|
||||||
"statuses" => statuses,
|
"statuses" => statuses,
|
||||||
"category" => a.category.title,
|
"category" => a.category.title,
|
||||||
"postdate" => a.postdate,
|
"postdate" => a.postdate,
|
||||||
|
|
Loading…
Reference in New Issue