Worth noting that error_messages_for is not included, by default, in Rails 3. If you check your console server log you'll see this warning:-

DEPRECATION WARNING: error_messages_for was removed from Rails and is now available as a plugin.
Please install it with `rails plugin install git://github.com/rails/dynamic_form.git`.

After you install the plugin, everything works as expected.