Three out of every 8 students suggested a rainbow-themed party, so the remaining students did not suggest a rainbow-themed party which is 8 - 3 = <<8-3=5>>5 students.
Since Joan has 40 students in her class, therefore those who did not suggest a rainbow-themed party is 5/8 * 40 = <<5/8*40=25>>25 students. Answer: \boxed{25}.