We show the Godbillon-Vey invariant arises as a `restricted Casimir invariant for three-dimensional ideal fluids associated to a foliation. We compare to a finite-dimensional system, the rattleback, where analogous phenomena occur.