Prepare the base by mixing the flour and the butter with a kitchen cutter. Then, add the salt and cold water and mix until a firm dough is formed. Knead the dough briefly by hand on a work surface.
Wrap the dough in cling film and rest in the fridge for 30 minutes.
In the meantime, peel the onions and slice them thinly on a chopping board. Sauté them in a pan with a little oil and a sprig of thyme. Season if required and put to one side.
Pre-heat the oven to 180°.
Roll out the pastry on a lightly floured surface. Cover the base of a rectangular baking tray measuring 36×12 cm or a round one with a 24 cm diameter.
Beat the ricotta with a fork in a bowl and season it with salt, pepper and nutmeg.
Spread the ricotta over the short crust pastry base and add a layer of onions on top of the ricotta.
Bake in the oven for about 25 minutes or until the pastry is golden brown
Our thanks to Maddalena of Cucina Scacciapensieri