Pressure cook the toor dal with 1/4 tsp of turmeric , and the tamarind (chunk if using) separately in a till soft and mash the toor dal well and keep aside. If using tamarind paste, don't pressure cook.
I used baby ridge gourd, so scrape lightly, but don't peel. If using normal ridge gourd. scrape the thorns / hard ridges out and peel the skin but not fully - the ridge gourd needs to hold shape even after slightly cook; Cut into medium sized chunks.
Meanwhile, in a pan, boil the ridge gourd chunks with minimal water, salt and a dash of turmeric till the vegetable is soft but not mushy. Turn off the heat.
In a seperate pan, add 2 tsp oil and roast all the ingredients except coconut and sambar powder of the masala ingredients ONE by ONE. Do not roast them together.
Now turn off the heat and add coconut and sauté well for 2-3 mins . Cool, grind with the Coconut- masala mixture along with the sambhar powder and the tamarind (paste or cooked) into a smooth thick paste adding adequate water.
Add this paste into the cooked ridge gourd and add requisite salt and let it come to a slow simmer.
Now add the cooked dal (reserve a little if you feel the gravy is too thick), jaggery and a little water (I used about 1/2 cup again) to get to a thickish gravy.
Let it simmer for 4-5 mins till the raw smell disappears.
Make the tempering (tadka) with the mentioned ingredients. Pour into the gravy and serve this side dish hot with Chapatis / Poori / Phulka / Steamed Rice.