Preheat the oven to 400 degrees.
Butter a small, shallow baking dish, about 7" x 10", or a 9-inch cast iron skillet and set aside.
Melt 3 tablespoons of butter in a large sauté pan over medium heat. Add the onions and cook for about 6-8 minutes, stirring occasionally, until they are softened but not browned.
Add the zucchini, toss around, then cover and cook for about 8 minutes until softened.
Add the salt, pepper and nutmeg, then sprinkle the flour over top and mix.
Add the milk, stir and continue cooking until the mixture has thickened, about 3-4 minutes.
Pour the zucchini mixture into the prepared baking dish.
Combine the breadcrumbs with the Gruyere cheese and sprinkle over the zucchini, then dot the remaining tablespoon of butter evenly over the top.
Bake for about 20 minutes or until the top is golden brown and bubbling.
Sprinkle chopped parsley or chives over the top to garnish, if desired. Allow to cool at least 10 minutes before serving.