Tuesday, March 16, 2010

Customize error_messages_for

Did you know that error_messages_for takes a whole bunch of options for customization?
<%= error_messages_for
:employee,
:class => "flash error",
:header_tag => "h4",
:header_message => "Sorry, the employee couldn't be created" %>

The options for the <div> that is returned include :header_tag, :id, :class, :header_message, :message and more.

Check out the docs on :error_messages_for for more.

No comments: