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.60 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.59 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.57 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.56 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.55 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.54 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.53 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.52 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.51 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.50 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.49 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.48 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.47 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.46 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.45 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.44 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.43 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.42 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.41 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.40 app/views/tenon/comments/index.json.jbuilder