I have heard that cucumber slices are a deterrent. How about planting cucumbers?
Getting Rid of Ants in Flower Beds
Certified GKH Gardening Expert
In my research I did not see where cucumber plants repelled ants. It was always suggested to use cucumber slices or cucumber peels. I think the reason is that by slicing and peeling the cucumbers you release more of the juices and the pungency that deters the ants.
Here are some additional resources on eradicating ants: