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

Version Path
tenon-1.1.4 app/views/tenon/posts/index.json.jbuilder
tenon-1.1.3 app/views/tenon/posts/index.json.jbuilder
tenon-1.1.2 app/views/tenon/posts/index.json.jbuilder
tenon-1.1.1 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.76 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.75 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.74 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.73 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.72 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.71 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.70 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.69 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.68 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.67 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.66 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.65 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.64 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.63 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.62 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.61 app/views/tenon/posts/index.json.jbuilder