There are some 'ant food'that the ants will carry back to their nest as a food - it is a poison however. The other thing that I have used is to salt their trail. That seems to work by it will not be great for the soil in your garden.
The poison (I have used and I will try anything first before poison) will work. My copy of 1001 All-Natural Secrets to a Pest-Free Property has these suggestions for ants:
Giving the Queen Heartburn:
3.5 ozs of sweet jam
1.5 T of wet canned cat food (cheap)
1 T of boric acid
The queen will eat it and dies in a few hours - keep out of reach of children and animals - it will make them very sick
If you do not want to kill the ants but just keep them away :
1/4 pound of dried peppermint (health food store)
1/4 pound rock dust (from nursery)
1/4 pound seaweed powder (from garden supply)
1/4 pound alfalfa meal (health food store)
1/4 pound cayenne pepper
place all ingredients in a well sealed jar or container and shake to mix. Avoid getting any of skin or eyes. Use small amounts where the ants frequent.
Keep away from children and pets.