Method: EffectivePostsHelper#post_meta

Defined in:
app/helpers/effective_posts_helper.rb

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



81
82
83
84
85
86
87
# File 'app/helpers/effective_posts_helper.rb', line 81

def (post, date: true, datetime: false, category: true, author: true)
  [
    ("#{post.published_start_at.strftime('%A, %B %d, %Y')}" if date && post.published_start_at),
    ("#{post.published_start_at.strftime('%A, %B %d, %Y · %l:%M%P')}" if datetime && post.published_start_at),
    ("#{post.user.to_s.presence || 'Unknown'}" if author && EffectivePosts. && post.user.present?)
  ].compact.join(' ').html_safe
end