In a small saucepan, gently fry the onion halves and garlic in the olive oil until the garlic is fragrant (don’t let it brown). Add the tomatoes and simmer, covered, for about an hour. In the meantime, make the gnudi. In a saucepan, fry the spinach until it’s just wilted and allow to cool. Squeeze out any excess moisture and chop finely. In a mixing bowl, combine the flour, chopped spinach, egg, ricotta and Parmesan. Mix vigorously until well combined. Dollop a spoonful of the mixture onto a floured surface and, using your (also floured) hands, roll into a cylindrical shape about an inch in diameter. Cut into 2cm or 3cm pieces and set aside. Repeat with the rest of the mixture. Bring a large pot of salted water to the boil, and plop in about a third of the gnudi (you don’t want them to be too crowded or they may stick together – also, too may will lower the temperature of the water). Let them cook for an extra minute after they’ve risen to the surface (about three to four minutes in total), then remove with a slotted spoon, set aside and keep warm. Drizzle with a little olive oil to prevent them from sticking together. Repeat with the remaining gnudi. While the last batch of gnudi is cooking, remove the onions from the tomato sauce and add the butter, stirring until it’s incorporated. Divide the gnudi between bowls and spoon over the tomato-butter sauce. Top generously with freshly grated Parmesan and serve.