Browse Source

Rails4: replace ActionView::Helpers::TextHelper#truncate by String#truncate at ApplicationHelper#format_activity_description

git-svn-id: http://svn.redmine.org/redmine/trunk@12835 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/2.5.0
Toshi MARUYAMA 10 years ago
parent
commit
8934e790fe
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      app/helpers/application_helper.rb

+ 1
- 1
app/helpers/application_helper.rb View File

@@ -232,7 +232,7 @@ module ApplicationHelper
end

def format_activity_description(text)
h(truncate(text.to_s, :length => 120).gsub(%r{[\r\n]*<(pre|code)>.*$}m, '...')
h(text.to_s.truncate(120).gsub(%r{[\r\n]*<(pre|code)>.*$}m, '...')
).gsub(/[\r\n]+/, "<br />").html_safe
end


Loading…
Cancel
Save