error_messages_for 'a'

hi all,

i have two models in single form and i want to display error messages for both on submission
when i do something like this i get an error

<%= error_messages_for ‘a’ %>
<%= error_messages_for ‘b’ %>

can anyone tell me how can i do something like this

thanks in advance

regards
gaurav