Sha256: f9ec82a283555b21088dcfbeaa7179573a2cd641f81068f9be485411f73310cf

Contents?: true

Size: 245 Bytes

Versions: 23

Compression:

Stored size: 245 Bytes

Contents

module PostsHelper
  def try_highlight(text, options = {})
    options[:length] ||= 100

    e = excerpt(text, params[:q].strip, radius: options[:length]) ||
      truncate(text, length: options[:length])

    highlight(e, params[:q])
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
social_stream-2.2.2 base/app/helpers/posts_helper.rb
social_stream-base-2.2.2 app/helpers/posts_helper.rb
social_stream-2.2.1 base/app/helpers/posts_helper.rb
social_stream-base-2.2.1 app/helpers/posts_helper.rb
social_stream-2.2.0 base/app/helpers/posts_helper.rb
social_stream-base-2.2.0 app/helpers/posts_helper.rb
social_stream-2.1.1 base/app/helpers/posts_helper.rb
social_stream-2.1.0 base/app/helpers/posts_helper.rb
social_stream-base-2.1.0 app/helpers/posts_helper.rb
social_stream-2.0.4 base/app/helpers/posts_helper.rb
social_stream-base-2.0.4 app/helpers/posts_helper.rb
social_stream-2.0.3 base/app/helpers/posts_helper.rb
social_stream-base-2.0.3 app/helpers/posts_helper.rb
social_stream-2.0.2 base/app/helpers/posts_helper.rb
social_stream-base-2.0.2 app/helpers/posts_helper.rb
social_stream-2.0.1 base/app/helpers/posts_helper.rb
social_stream-base-2.0.1 app/helpers/posts_helper.rb
social_stream-2.0.0 base/app/helpers/posts_helper.rb
social_stream-base-2.0.0 app/helpers/posts_helper.rb
social_stream-2.0.0.beta3 base/app/helpers/posts_helper.rb