Wahidi in his Tafsir has related from Ibn Abbas that Ali (a.s) had four dirhams and nothing beyond that. He gave in charity a dirham at night and a dirham during the day. Another one he gave secretly and one, openly. Then the Almighty Allah revealed the following verse:
(As for) those who spend their property by night and by day, secretly and openly (Surah Baqarah 2:274)
Thalabi has written in his Tafsir that Abu Zar Ghiffari narrated that one day he was praying with the Messenger of Allah (S) when a beggar came to the mosque soliciting alms, but none gave him anything.
Amir’ul-Mu’minin (a.s) was also praying, but he indicated the small finger of his right hand on which he was wearing a ring and gave the ring to the beggar. Thus the Almighty Allah revealed the following verse:
Only Allah is your Guardian and His Apostle and those who believe, those who keep up prayers and pay the poor-rate while they bow. (Surah Maidah 5:55)
Reference :Akhlaq al-A’imma, Morals & Manners of the Holy Imams