Make the pineapple mixture first. Melt the butter in a 10-inch cast iron skillet over low heat. stir in the brown sugar with a wooden spoon. when the mixture begins to caramelize and become darker, remove from heat. Carefully stir in the rum, and then arrange the pineapple triangles on the mixture in a single layer. set pan aside and heat the oven to 350 degrees.
Sift the flour, baking powder, salt, nutmeg and ginger into a bowl. Gently stir in the shredded coconut. in a large mixing bowl, cream the butter and sugar. add the vanilla and rum. add the egg. add the milk and dry ingredients to this mixture, alternating wet and dry until everything is just incorporated.
Spread the batter over the pineapple mixture in the skillet. Bake for 40 minutes, or until the top is golden brown and a toothpick comes out clean.
Cool for 15 minutes. Run a knife around the edges. invert onto a serving plate. serve plain, or with a dollop of whipped cream and a sprinkling of toasted coconut.