When replacing the old light bar in our bathroom and there was no box in the wall just a "hole with a wire". My son-in-law said that was fine and hung the new light bar securing it with clips to the drywall. I thought we needed to install a header and secure a box to it and then install the light. What does the code say?
For bar/strip type lights you cannot just run the wire into a hole in the back of the fixture. You can run it into a standard knockout hole with a cable clamp (romex connector).
Sometimes I feel like if I answer any more questions it is like someone trying to climb over a fence to jump off a bridge and me giving them a boost.
Answers based on the 2008 & 2011 NEC.