How are Gandhi’s ethical/ political views grounded in his religious/ metaphysical/ philosophical views?

In what sense can Gandhi’s life be considered a success? Returning to the Socratic credo “a good man is not harmed in life or death” and “better to suffer injustice than to do injustice” (cf. Discussion above on the Apology and Gorgias), is Gandhi’s life proof of these claims? How are Gandhi’s ethical/ political views grounded in his religious/ metaphysical/ philosophical views?