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.1.4 app/views/tenon/comments/index.json.jbuilder
tenon-1.1.3 app/views/tenon/comments/index.json.jbuilder
tenon-1.1.2 app/views/tenon/comments/index.json.jbuilder
tenon-1.1.1 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.76 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.75 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.74 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.73 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.72 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.71 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.70 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.69 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.68 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.67 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.66 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.65 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.64 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.63 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.62 app/views/tenon/comments/index.json.jbuilder
tenon-1.0.61 app/views/tenon/comments/index.json.jbuilder