To make a fool of oneself / to commit a gaffe
Acabei de dar uma rata daquelas na frente de todo mundo.
I just made a complete fool of myself in front of everyone.
The noun rata means a public blunder or gaffe. Standard reference dictionaries (Priberam, Infopédia) classify the etymology as uncertain — possibly related to ratão.
Falando's Idiom Trainer teaches you to recognize idiom meanings and create sentences using them, so you can speak like a Brazilian.