Empty validation error messages?

Hello,

I’m have a form and the error messages are not being displayed properly

I got a remote_form_for and am trying to show errors like I always do:
<%= error_messages_for @user%>

but the output is:
4 errors prohibited this user from being saved

There were problems with the following fields:

* {{attribute}} {{message}}
* {{attribute}} {{message}}
* {{attribute}} {{message}}
* {{attribute}} {{message}}

When I use this method, the errors are being displayed correctly:
<% for error in @user.errors %>
<%= ‘’+error[0]+’ - ‘+error[1]+’

%>
<% end %>

Does anyone know why the error_messages_for does not work?

Heinz S. wrote:

I got a remote_form_for and am trying to show errors like I always do:
<%= error_messages_for @user%>

Sorry, pasted the wrong line. It’s this:
<%= error_messages_for :user %>

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs