truncate textilizable

This commit is contained in:
yanxd 2013-10-18 10:00:06 +08:00
parent 9fa9aa0fb8
commit e2447b4c88
2 changed files with 2 additions and 2 deletions

View File

@ -1400,6 +1400,6 @@ module ApplicationHelper
#end #end
#author : nyan #author : nyan
def stringCut240(str) def stringCut240(str)
(str.length > 240) ? (str[0,240]<<"\n......") : str (str.length > 240) ? (str[0,240]<<"......") : str
end end
end end

View File

@ -23,7 +23,7 @@
<td colspan="2" width="580px" > <td colspan="2" width="580px" >
<p class="font_description"> <p class="font_description">
<!-- modify by nyan --> <!-- modify by nyan -->
<%= textilizable( stringCut240(e.event_description) ) %> <%= textilizable( truncate(e.event_description, length: 240 ) %>
</p></td> </p></td>
</tr> </tr>
<tr> <tr>