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.0.39 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.38 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.37 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.36 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.35 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.33 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.32 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.31 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.30 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.29 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.28 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.27 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.26 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.25 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.24 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.23 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.22 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.21 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.20 app/views/tenon/posts/index.json.jbuilder
tenon-1.0.19 app/views/tenon/posts/index.json.jbuilder