When the dual of an ideal is a ring