Heat a spray of oil in a large pan and fry the onion and garlic for 10 minutes until soft but not coloured.
Add the spinach and cook for 5 minutes, stirring. Tip into a sieve and press to remove as much excess liquid as possible. Cool.
Beat the egg with the ricotta and nutmeg and season.
Stir in the feta with the spinach and onion.
Heat the oven to 200C/fan 180C/gas 6.
Spray a 20cm loose-based cake tin with a little oil. Line with the filo sheets, leaving excess pastry overhanging and brushing each sheet with melted butter.
Spoon the cheese and spinach mixture into the tin. Bring the pastry up and over the top of the pie. Brush generously with melted butter.
Bake for 25-30 minutes until golden brown and crisp.