Companion plants like garlic and mint are supposed to deter ants from the area. Since mint spreads quickly, you might have to keep it in a submerged container to control the roots. Use garlic plants, but plan ahead since you plant the garlic in the fall for harvesting the following year.
If you plant cabbage early in the spring, set out a few ant cups in the garden so that the ants take the poison back to their nests and kill off the queen ant, destroying the source of ants. Place the cups upside-down to keep rain from washing them out.
Boric acid kills ants without harming the cabbage plant. Some gardeners sprinkle it over the ground around the ant nests. Horticulturist Ron Smith of the North Dakota State University Extension advises gardeners to fill small bottles with cotton balls and saturate with a mixture of 1 cup of water, 1/2 cup of sugar and 1 1/2 tsp. of boric acid. Poke some holes in the cover, and lay it on its side near the ant hill. The sugar attracts the ants, and the boric acid kills them.
Drenching the area with water from your garden hose also helps discourage the ants from living in the wet environment. Soak the area with a slow stream of water every day until you don't see any ants nearby. You should see the ants leaving quickly in a steady stream, carrying the white eggs with them.