# File lib/action_view/helpers/text_helper.rb, line 48 def truncate(text, length = 30, truncate_string = "...") if text.nil? then return end l = length - truncate_string.chars.length (text.chars.length > length ? text.chars[0...l] + truncate_string : text).to_s end