Poisoned bait is a common method for controlling rats, mice, birds, slugs, snails, ants, cockroaches, and other pests. The basic granules, or other formulation, contains a food attractant for the target species and a suitable poison. For ants, a slow-acting toxin is needed so that the workers have time to carry the substance back to the colony, and for flies, a quick-acting substance to prevent further egg-laying and nuisance. Baits for slugs and snails often contain the molluscide metaldehyde, dangerous to children and household pets.
An article in Scientific American in 1885 described effective elimination of a cockroach infestation using fresh cucumber peels.
Read more, here.