Yes, it's my understanding the cinnamon kills the fungus, which is what the gnats are eating.
I've also had pretty good luck luring the gnats away with a glass bowl with lemon juice and a tiny drop of dish detergent. They seem attracted to it, and drown. Vinegar works for this too. Cover the glass bowl with some sort of saran type wrap, and poke holes in it with a knife. For some reason they get in, but can't find there way out.