json.students do json.array! @students do |student| json.user_id student.user_id json.login student.user.try(:login) json.name student.user.try(:real_name) json.name_link user_path(student.user) json.student_id student.user.try(:student_id) json.course_group_name student.course_group.try(:name) json.course_member_id student.id end end json.students_count @students_count if @course_group.present? json.course_group_name @course_group.name json.invite_code @course_group.invite_code end