json.id discuss.id json.content content_safe(discuss.content) json.time time_from_now(discuss.created_at) json.hack_id discuss.dis_id # 主贴和回复有一些不同点 if discuss.parent_id json.can_delete discuss.can_deleted?(current_user) else json.praise_count discuss.praises_count json.user_praise discuss.praise_treads.select{|pt| pt.user_id == current_user.id}.length > 0 end