Method: EffectivePostsHelper#post_meta

Defined in:
app/helpers/effective_posts_helper.rb

#post_meta(post, date: true, datetime: false, category: true, author: true) ⇒ Object



55
56
57
58
59
60
61
62
63
# File 'app/helpers/effective_posts_helper.rb', line 55

def (post, date: true, datetime: false, category: true, author: true)
  [
    'Published',
    ("on #{post.published_at.strftime('%B %d, %Y')}" if date),
    ("on #{post.published_at.strftime('%B %d, %Y at %l:%M %p')}" if datetime),
    ("to #{link_to_post_category(post.category)}" if category && Array(EffectivePosts.categories).length > 1),
    ("by #{post.user.to_s.presence || 'Unknown'}" if author && EffectivePosts. && post.user.present?)
  ].compact.join(' ').html_safe
end