You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/views/weapps/course_member_attendances/index.json.jbuilder

16 lines
707 B

json.member_attendances @member_attendances.each_with_index.to_a do |member, index|
json.(member, :user_id, :attendance_status)
json.index (@page.to_i - 1) * @limit.to_i + index + 1
json.user_name member.user&.real_name
json.student_id member.user&.student_id
end
# json.member_attendances @members.each_with_index.to_a do |member, index|
# json.(member, :user_id)
# json.index (@page.to_i - 1) * @limit.to_i + index + 1
# 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