The best used to be made at Grantham, and Grantham
gingerbread was as much a locution as Everton toffy, or tuffy as we
used to call it in the first half of the nineteenth century.
To get the gilt off the gingerbread.
To appropriate all the fun or profit and leave the caput mortuum
behind. In the first half of the nineteenth century gingerbread cakes
were profusely decorated with gold-leaf or Dutch-leaf, which looked
(g soft). Brummagem wares, showy but worthless. The
allusion is to the gilt gingerbread toys sold at fairs.
Source: Dictionary of Phrase and Fable, E. Cobham Brewer, 1894