# json.member_attendances @member_attendances.each do |member| # json.(member, :user_id, :attendance_status) # json.user_name member.user&.real_name # json.student_id member.user&.student_id # end json.member_attendances @members.each do |member| json.(member, :user_id) json.user_name member.user&.real_name json.student_id member.user&.student_id json.attendance_status @member_attendances.select{|attendance| attendance.course_member_id == member.id}.first&.attendance_status || "ABSENCE" end json.members_count @members_count