From e2447b4c889ea771ffdca8712c9349955fb5c823 Mon Sep 17 00:00:00 2001 From: yanxd Date: Fri, 18 Oct 2013 10:00:06 +0800 Subject: [PATCH] truncate textilizable --- app/helpers/application_helper.rb | 2 +- app/views/projects/show.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8b9e469f0..571eb0b81 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1400,6 +1400,6 @@ module ApplicationHelper #end #author : nyan def stringCut240(str) - (str.length > 240) ? (str[0,240]<<"\n......") : str + (str.length > 240) ? (str[0,240]<<"......") : str end end diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 903ad70ff..130d343bc 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -23,7 +23,7 @@

- <%= textilizable( stringCut240(e.event_description) ) %> + <%= textilizable( truncate(e.event_description, length: 240 ) %>