Gerard Butler struggled to keep away from the cake

Gerard Butler had to have an on-set chaperone to stop him from eating cupcakes.

The “Law Abiding Citizen” actor's co-star Jamie Foxx took great pleasure in mocking the Scottish hunk as he struggled to stay in shape ahead of filming a nude scene for the movie.

"He was followed around by a trainer for most of the film,” Foxx said. “And his main job was to stop him from eating cupcakes. I understand; he had to do his whole thing for the ladies, which is great. But that nude scene is when we men go to the concession stand."

Foxx loved getting the chance to work with Butler in the film because he had previously appeared in one of “The Soloist” actor’s favorite movies – “300.”

Foxx told the Scotsman Web site: "'300' was my movie. I'd go around saying the lines. Gerard probably thought I was stalking him because I had his DVD playing in my trailer the whole time. A lot of times you choose projects just because of the script, or the money or the opportunity to build those memories."