Sha256: 9e117f318c47196a6ddbd5ec5754a85d85af09a88ce24545301b0902928d35f4
Contents?: true
Size: 653 Bytes
Versions: 59
Compression:
Stored size: 653 Bytes
Contents
# frozen_string_literal: true module Decidim module Blogs module Admin # Custom helpers used in posts views module PostsHelper include Decidim::ApplicationHelper include SanitizeHelper # Public: truncates the post body # # post - a Decidim::Blog instance # max_length - a number to limit the length of the body # # Returns the post's body truncated. def post_description_admin(post, max_length = 100) body = translated_attribute(post.body) CGI.unescapeHTML html_truncate(body, max_length: max_length) end end end end end
Version data entries
59 entries across 59 versions & 1 rubygems