view app/helpers/application_helper.rb @ 89:d5a0d66ee457

Finish updating to rails 5
author nanaya <me@myconan.net>
date Sat, 02 Jul 2016 16:26:00 +0900
parents f91e2d00f03f
children 0c8a8b390145
line wrap: on
line source

module ApplicationHelper
  include Twitter::Autolink

  def ellipsize(text, limit = 30)
    if text.length <= limit
      text
    else
      "#{text.first(limit)}..."
    end
  end
end