Reputation: 17430
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 ?
Upvotes: 0
Views: 264
Reputation: 5426
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 %>
Upvotes: 1