01 - Preheat the oven to 400°F. Lightly grease a medium baking dish.
02 - Bring a large pot of salted water to a boil. Cook the pasta 2 minutes less than package instructions for al dente. Drain and set aside.
03 - Melt the butter in a large skillet over medium heat. Add the chopped onion and cook until soft, about 3 to 4 minutes. Stir in the minced garlic and cook for an additional minute.
04 - Sprinkle the flour into the skillet and stir continuously for 1 minute. Gradually whisk in the milk and cream, bringing the mixture to a simmer. Cook, stirring constantly until thickened, approximately 3 to 4 minutes.
05 - Add shredded mozzarella, grated Parmesan, ricotta, salt, pepper, and a pinch of nutmeg to the sauce. Stir until all the cheese melts and the sauce is smooth.
06 - Stir in the fresh spinach and cook until just wilted, about 1 to 2 minutes.
07 - Mix the drained pasta with the cheese sauce thoroughly and transfer the mixture into the prepared baking dish.
08 - Sprinkle the remaining mozzarella and Parmesan evenly over the top. Bake in the preheated oven for 20 to 25 minutes, until golden and bubbling.
09 - Allow the dish to rest for 5 minutes before serving to set.