@ -32,8 +32,7 @@ class CommentsController < ApplicationController
# 列表
def index
logger.info("##########hack:#{@hack.id}")
discusses = Discuss.where(root_id: nil, dis_id: @hack.id, dis_type: @hack.class.to_s)
discusses = @hack.discusses.where(root_id: nil)
@discusses_count = discusses.count
@discusses= paginate discusses
end
@ -1,4 +1,4 @@
json.disscuss_count @discusses
json.disscuss_count @discusses_count
json.comments @discusses do |discuss|
json.partial! 'comments/discuss', locals: { discuss: discuss}
json.children discuss.child_discuss(current_user) do |c_d|