ただ + [noun] + のみ ただ + [verb (plain)] + のみ
ただ~のみ means "nothing but", "only": one thing and nothing else. のみ is the written equivalent of だけ, and ただ in front makes the limit absolute. It goes on a noun or on a verb in the plain form, and belongs to formal writing and narration.
Particles such as が and を go after のみ, where they would go after だけ.
After a verb, ただ~のみ says that this one thing happened or is happening, and nothing more.
At the end of a sentence with だ, it usually means "all that is left is to…", which is the pattern ただ〜~のみだ.
のみ and だけ mean the same, but the register is far apart. In conversation the word is だけ, and ただ~のみ in speech sounds stiff and dramatic, like a line read from a novel.