Tightly packed elastic structures can be found in a wide variety of physical and biological systems. Traditionally mechanical and geometrical aspects are treated separately due to the complex nature of the observed patterns (e.g. a piece of crumpled paper). We present a statistical field theory to study the packing of an elastic rod (1D) confined in 2D space. An advantage of this approach is that it puts on an equal footing geometry and mechanics. We show that a self-reorganization of the rod becomes favorable at a critical density. This configurational phase transition (isotropic-nematic) leads to a more efficient packing. For even higher confinements we predict the existence of a jamming transition hinting at the glassy character of this system.