as you all may know error_messages are deprecated:
DEPRECATION WARNING: f.error_messages 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
Installing the plugin of course helps but I’ve been googling a bit and
stuff but couldn’t find the proper new Rails 3 way of handling the error
messages. Can someone please tell me how to do it without that plugin?
as you all may know error_messages are deprecated:
DEPRECATION WARNING: f.error_messages 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
Installing the plugin of course helps but I’ve been googling a bit and
stuff but couldn’t find the proper new Rails 3 way of handling the error
messages. Can someone please tell me how to do it without that plugin?
I believe the idea is that you can write your own helper method to
format the errors exactly how you want them. You can access the error
messages directly by using the #errors method on the Active Record
object; for example:
person.errors.full_messages
Documentation for that is here:
The source for the error_messages_for method in the dynamic_form
plugin might also be a source of ideas:
Ok, guys, we can write our own helper… but why, when it is ready?
Start (with Rails 3) a new project and scaffold a dummy resource.
Then, copy the error handling from the _form partial thus generated and
adapt it to your needs.
It think it is the best way to learn how to code as an insider, provided
scaffolding is maintained by insiders.