mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-29 20:25:09 -04:00
13 lines
374 B
Ruby
13 lines
374 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PostsHelper
|
|
def display_post_truncated(post, length: 300)
|
|
truncate(strip_tags(post.body), length: length,
|
|
separator: ' ', omission: '... ') { link_to "Read more", post_path(post) }
|
|
end
|
|
|
|
def post_stripped_tags(post, length: 300)
|
|
truncate(strip_tags(post.body), length: length)
|
|
end
|
|
end
|