Yes you can wire it the same with 10/2. A neutral wire is not needed and would never see any current. Even the ground in a 220 circuit doesn't really do anything...its just there for safety. That's true for your air compressor. Some appliances, however, use both a 220 and a 110 where the 110 might power a clock, for example. In that case you need a red, black, white and ground or a 4-wire circuit which allows for both 220 and 110 usage. So there are 2 kinds of 220/240v wiring schemes depending on what you're wiring.
Welders and air compressors only use 220 and no 110 so that's why a black, white(black) and ground is sufficient.
When you use the white wire as a hot you should color a couple inches on the end with a black marker or wrap some black electrical tape on it to color code it as a hot wire.
Instead of replacing the 12/2 you could replace the breaker with a 2 pole 20 amp which would be fine for your 15 amp compressor.