One of the bulletin boards in the hallway outside of the Ramírez-Andreotta laboratory at the University of Arizona had the following poster that describes how to use red cabbage for measuring pH:
It may be possible to use red cabbage to measure the pH of soils as well. To measure soil pH, soil must first be added to water. To measure soil pH with the red cabbage indicator, soil could simply be added to the indicator solution.
The blog post associated with the poster can be found here. That blog post references an earlier post about using the petals of poinsettia plants in a similar fashion, as they also contain anthocyanin pigments.