class Rcms::Tiding
Public Instance Methods
get_short_desc(l = 110)
click to toggle source
# File lib/generators/templates_tidings/app/models/rcms/tiding.rb, line 15 def get_short_desc l = 110 description.present? ? truncate(description, l) : truncate(text, l) end
truncate(text, l = 110)
click to toggle source
# File lib/generators/templates_tidings/app/models/rcms/tiding.rb, line 19 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
Protected Instance Methods
should_generate_new_friendly_id?()
click to toggle source
# File lib/generators/templates_tidings/app/models/rcms/tiding.rb, line 27 def should_generate_new_friendly_id? !slug.present? end