Cook the pasta in boiling salted water for about 15 minutes. In the meantime grate cheese finely. Peel onions, cut into rings and turn them in flour. Wash parsley, dab dry and cut into strips. Drain the spaetzle and let it drain.
Mix spaetzle and cheese and put them into an ovenproof casserole dish. Bake in a preheated oven (electric cooker: 175 °C/ convection oven: 150 °C/ gas: level 2) for approx. 15 minutes. In the meantime heat oil in a pan and fry onions until golden brown. Take them out and let them drip off on kitchen paper. Remove the casserole from the oven and serve sprinkled with onion rings and parsley