Sha256: 2eab41c35ae9e0492fd3bd5586c0125b1b052a1922259a80a567b198e9e80d1e

Contents?: true

Size: 968 Bytes

Versions: 79

Compression:

Stored size: 968 Bytes

Contents

json.records do
  json.array!(@comments) do |comment|
    json.extract!(comment, :id, :author, :author_email, :commentable_type, :commentable_id, :content)
    json.gravatar gravatar_for(comment)

    if comment.commentable.posted? && route_exist?(comment.commentable)
      json.commentable_link link_to("#{comment.commentable.title}", main_app.polymorphic_path(comment.commentable), :target => "_")
    else
      json.commentable_link comment.commentable.title
    end

    json.read_link action_link("Read", '#', 'eye', 'data-modal-target' => "#comment-#{comment.id}", 'data-modal-title' => 'Read Comment')
    json.approval_link toggle_link(comment, 'approved', toggle_approved_comment_path(comment), ['thumbs-up', 'Approved'], ['thumbs-down', 'Not Approved'])
    json.delete_link delete_link(comment)
  end
end

json.pagination do
  json.currentPage @comments.current_page
  json.totalPages @comments.total_pages
  json.totalEntries @comments.total_entries
end

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
tenon-1.0.39 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.38 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.37 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.36 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.35 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.33 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.32 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.31 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.30 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.29 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.28 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.27 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.26 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.25 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.24 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.23 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.22 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.21 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.20 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.19 app/views/tenon/comments/index.json.jbuilder