A grammar book says I should place adverb between subject and main verb. So this should be right.
When I was a student, I only pulled an all-nighter once.
How about this one?
When I was a student, I pulled an all-nighter only once.
Is it right? Is it idiomatic?