You've heard correctly - tapping "Erase All Content and Settings" on a jailbroken device will just cause it to get stuck on the Apple logo while booting until you restore it with iTunes (because the filesystems of jailbroken devices are slightly rearranged).
The only way to remove the jailbreak from a jailbroken device is to restore it with iTunes on a computer.
(If your device is stuck on the Apple logo and you want to restore it, you may have to put the device into DFU mode before iTunes can read it. You can do this by plugging your device into a computer that has iTunes installed, holding the power (lock) button and home button for 10 seconds, then releasing the power button while you keep holding the home button for another 15 seconds. Then iTunes should recognize it and allow you to restore it.)