The Jataka, Volume I, tr. by Robert Chalmers, , at sacred-texts.com
"As fares his worshipper."--This story was told by the Master when at Sāvatthi, about a very poor man.
Now at Sāvatthi the Brotherhood with the Buddha at their head used to be entertained now by a single family, now by three or four families together. Or a body of people or a whole street would club together, or sometimes the whole city entertained them. But on the occasion now in question it was a street that was skewing the hospitality. And the inhabitants had arranged to provide rice-gruel followed by cakes.
Now in that street there lived a very poor man, a hired labourer, who could not see how he could give the gruel, but resolved to give cakes. And he scraped out the red powder from empty husks and kneaded it with water into a round cake. This cake he wrapped in a leaf of swallow-wort, and baked it in the embers. When it was done, he made up his mind that none but the Buddha should have it, and accordingly took his stand immediately by the Master. No sooner had the word been given to offer cakes, than he stepped forward quicker than anyone else and put his cake in the Master's alms-bowl. And the Master declined all other cakes offered him and ate the poor man's cake. Forthwith the whole city talked of nothing but how the All-Enlightened One had not disdained to eat the poor roan's bran-cake. And from porters to nobles and King, all classes flocked to the spot, saluted the Master, and crowded round the poor man,
offering him food, or two to five hundred pieces of money if he would make over to them the merit of his act.
Thinking he had better ask the Master first, he went to him and stated his case. "Take what they offer," said the Master, "and impute your righteousness to all living creatures." So the man set to work to collect the offerings. Some gave twice as much as others, some four times as much, others eight times as much, and so on, till nine crores of gold were contributed.
Returning thanks for the hospitality, the Master went back to the monastery and after instructing the Brethren and imparting his blessed teaching to them, retired to his perfumed chamber.
In the evening the King sent for the poor man, and created him Lord Treasurer.
Assembling in the Hall of Truth the Brethren spoke together of how the Master, not disdaining the poor man's bran-cake, had eaten it as though it were ambrosia, and how the poor man had been enriched  and made Lord Treasurer to his great good fortune. And when the Master entered the Hall and heard what they were talking of, he said, "Brethren, this is not the first time that I have not disdained to eat that poor man's cake of bran. I did the same when I was a Tree-sprite, and then too was the means of his being made Lord Treasurer." So saying he told this story of the past.
Once on a time when Brahmadatta was reigning in Benares, the Bodhisatta was a Tree-sprite dwelling in a castor-oil plant. And the villagers of those days were superstitious about gods. A festival came round and the villagers offered sacrifices to their respective Tree-sprites. Seeing this, a poor man shewed worship to the castor-oil tree. All the others had come with garlands, odours, perfumes, and cakes; but the poor man had only a cake of husk-powder and water in a cocoanut shell for his tree. Standing before it, he thought within himself, "Tree-sprites are used to heavenly food, and my Tree-sprite will not eat this cake of husk-powder. Why then should I lose it outright? I will eat it myself." And he turned to go away, when the Bodhisatta from the fork of his tree exclaimed, "My good man, if you were a great lord you would bring me dainty manchets; but as you are a poor man, what shall I have to eat if not that cake? Rob me not of my portion." And he uttered this stanza:--
Then the man turned again, and, seeing the Bodhisatta, offered up his sacrifice. The Bodhisatta fed on the savour and said, "Why do you worship me?" "I am a poor man, my lord, and I worship you to be eased of my poverty."  "Have no more care for that. You have sacrificed to one who is grateful and mindful of kindly deeds. Round this tree, neck to neck, are buried pots of treasure. Go tell the King, and take the treasure away in waggons to the King's courtyard. There pile it in a heap, and the King shall be so well-pleased that he will make you Lord Treasurer." So saying, the Bodhisatta vanished from sight. The
man did as he was bidden, and the King made him Lord Treasurer. Thus did the poor man by aid of the Bodhisatta come to great fortune; and when he died, he passed away to fare according to his deserts.
His lesson ended, the Master identified the Birth by saying, "The poor man of to-day was also the poor man of those times, and I the Tree-sprite who dwelt in the castor-oil tree."