Sha256: 2f7771c2a4dcf1700e8b26636ef9347f8b542a8fa3f5a0866ca8b271020c8fbe
Contents?: true
Size: 751 Bytes
Versions: 79
Compression:
Stored size: 751 Bytes
Contents
json.records do json.array!(@posts) do |post| json.extract!(post, :title, :to_param, :id) json.publish_at post.publish_at.present? ? post.publish_at.strftime('%B %e, %Y at %l:%m%p') : 'Date not set' json.edit_path edit_post_path(post) if post.published? && main_app.respond_to?(:post_path) json.view_link action_link('View on Site', main_app.post_path(post), 'laptop') end json.categories post.post_categories.map{ |c| c.title }.join(', ') json.edit_link edit_link(post) json.delete_link delete_link(post) json.author post.user.email if post.user.present? end end json.pagination do json.currentPage @posts.current_page json.totalPages @posts.total_pages json.totalEntries @posts.total_entries end
Version data entries
79 entries across 79 versions & 1 rubygems