Heat oven to 200C/180C fan/gas 6. Heat oil in a large non-stick frying pan and cook the onion for 5-6 mins until softened and lightly golden. Add the tomatoes and toss for 1 min to soften.
Remove from the heat, add the spinach leaves and basil, and toss together to wilt a little. Transfer all the ingredients to a greased 30cm x 20cm rectangular baking tin. Take small scoops of the ricotta and dot over the vegetables.