class Rcms::Mention

Public Instance Methods

get_short_desc(l = 110) click to toggle source
# File lib/generators/templates_mentions/app/models/rcms/mention.rb, line 9
def get_short_desc l = 110
  truncate(text, l)
end
truncate(text, l = 110) click to toggle source
# File lib/generators/templates_mentions/app/models/rcms/mention.rb, line 13
def truncate text, l = 110
  return nil if text.nil?
  text = ActionView::Base.full_sanitizer.sanitize(text)
  text.length > l ? text.truncate(l) : text
end