Method: EffectivePostsHelper#post_meta

Defined in:
app/helpers/effective_posts_helper.rb

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



46
47
48
49
50
51
52
53
54
# File 'app/helpers/effective_posts_helper.rb', line 46

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 #{(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