views:

30

answers:

1

Article HABTM authors

In Article model, i say:

validates_associated :authors

But, by creating of the new Article, this validation does't happen, because i don't see the errors.

Another errors are displayed properly, but this.

I render errors so:

<div class="errors">
    <%= article_form.error_messages %>
</div>

What's wrong here ?

+1  A: 

Validates_associated should work with any kind of association. Try to display your errors either with:

<%= @article.errors.full_messages.to_sentence %>

or

<%- for author in @article.authors %>
  <%= author.errors.full_messages.to_sentence %>
<%- end %>
Yannis