ままに・ がままにas you please; just as told
You let something else steer and add nothing of your own. If it is your mood, that is freedom: 気の向くままに. If it is another person, it is giving in: 言われるがままに. The まま of 開けたまま, "left as it is", is a different use.
your own whim
I wandered through an unfamiliar town wherever my fancy took me.
what someone tells you
He did exactly as the other person told him and even revealed his PIN.
Your own whim, or the wind
Verb (dictionary form) + まま(に) / Noun + の + まま(に)
A handful of set phrases, not a free pattern: 気の向くまま, 足の向くまま, 思うまま. The に can be left off. The noun is a wish or an urge: 心, 思い, 本能 (instinct).
What someone tells you
Verb (passive) + がまま(に)
言われるがままに. The が can be left out: 言われるまま. Without the passive, the other person takes の: 親の言うがまま.
As the mood takes you
Each is learned whole, and said as well as written. For anything else, "as you like" is 好きなように.
気の向くまま(に)as the mood takes you
When I travel, I turn down side streets as the mood takes me.
足の向くまま(に)wherever your feet take you
Let's make no plans today and walk wherever our feet take us.
思うまま(に)just as you like
Try drawing a picture just as you please.
Also 思うがままに.
心のまま(に)as your heart tells you
She followed her heart and turned her feelings that day into a song.
Also 心の赴くままに.
風の吹くまま(に)wherever the wind blows
The small boat moved across the lake wherever the wind carried it.
Just as you are told
With a passive it is a free pattern. Verbs of telling, urging and leading all go before がまま: 言われる, 勧められる, 誘われる, 促される. It is often a criticism: you didn't stop to think.
Urged on by the person in charge, I signed without checking what it said.
We went wherever the guide led us, along the narrow mountain path.
No criticism here, only trust.
Two fixed phrases say you are helpless:
されるがままletting them do as they like with you
The cat just let the children do what they liked with it.
なすがままat the mercy of
In the second half of the match, we were completely at our opponents' mercy.
Close neighbours
たままN4
The everyday まま, after a た-form: still that way, where you would expect a change.
I accidentally fell asleep with the window open.
とおり・どおりN3
Exactly as said, shown or planned. It only reports that the instructions were followed, with no criticism in it.
I entered the number exactly as the attendant instructed.
Check yourself
1What does this tell you about him?
彼は
Choose an answer to see why.
2Which one fits?
彼女は
Choose an answer to see why.
More detail
あるがまま and ありのまま are "just as it is", with nothing dressed up: ありのままの自分, the real me.
More sentences
On my days off, I like to stroll wherever my feet take me.
He wrote down his thoughts exactly as he wished.
She kept writing poetry as her heart led her.
She joined the project simply because everyone around her urged her to.
Carried away by the advertising, I ended up buying even products I did not need.
He does whatever his parents say.
The dictator enjoyed unchecked power and wealth.
ほしいままにする, a set phrase: to enjoy power, fame or wealth unchecked.