Cook the pasta in plenty of salted water according to the instructions on the packet. Then drain through a sieve.
Peel and dice the onions. Cut the cooked ham into strips. Wash tomatoes and cut into pieces.
Heat olive oil and fry the onions in it. Add the ham and tomatoes and fry briefly. Add the spinach leaves and let thaw. Add the cottage cheese and season with salt and pepper. Fold in the pasta. Arrange everything on plates and serve immediately.