I learned that the particle に is meant to mark the place in a phrase, similar to in, on and at. But today I was reading Yotsubato and I came across this phrase 元気にしてたか and obviously this rule doesn't apply to 元気.
It didn't stop me to understand the conversation (at least I think so), I presume it meant something like:
How you doing? Good?
Am I wrong in this? Why use the particle に in this phrase?