In a large bowl, combine the flour, ricotta cheese, eggs, milk, salt, and nutmeg. Mix until a thick batter forms.
Bring a large pot of salted water to a boil. Using a spoon or a small ice cream scoop, drop spoonfuls of the batter into the boiling water. Cook for 3-4 minutes, or until the dumplings float to the surface. Remove them with a slotted spoon and set aside.
In a skillet, melt the butter over medium heat. Add the chopped onion and cook until golden brown and caramelized, about 8-10 minutes.
Preheat your oven to 375°F (190°C). In a baking dish, layer the cooked dumplings with the grated cheese. Pour the caramelized onions and melted butter over the top.
Bake for 15-20 minutes, or until the cheese is melted and bubbly.
Season with salt and pepper to taste. Garnish with chopped fresh chives or parsley.
Enjoy your meal!