From 1df28c21c178889d4699606bfc3445702cb435c4 Mon Sep 17 00:00:00 2001 From: nccu Date: Fri, 30 Jan 2015 11:10:58 +0800 Subject: [PATCH] add subtitle word limit --- app/controllers/news_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index 3809e38..c945e24 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -133,9 +133,10 @@ class NewsController < ApplicationController "status-class" => "status-#{status['classname']}" } end + { "title" => HTMLEntities.new.encode(a.title), - "subtitle" => a.subtitle, + "subtitle" => a.subtitle.truncate(100), "statuses" => statuses, "category" => a.category.title, "postdate" => a.postdate,