I prefer to put a lock through both, the rim and the frame, but u-locks are REALLY narrow, and depending on what you lock to and your type of rims (I have deep section ones) sometimes you can't do both. That was my case tonight, so the next best thing was the u-lock through just the rim.
It worked. Not ideal but it worked.