Skip to content

Commit

Permalink
override errors method in HasManyAssociation field type to show valid…
Browse files Browse the repository at this point in the history
…ation message
  • Loading branch information
samdebutcha committed Sep 22, 2011
1 parent 614b4a5 commit 1982788
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/rails_admin/config/fields/types/has_many_association.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ def dom_name
def method_name
"#{super.to_s.singularize}_ids" # name_ids
end

# Reader for validation errors of the bound object
def errors
bindings[:object].errors[name]
end

end
end
end
Expand Down

1 comment on commit 1982788

@bbenezech
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Please sign in to comment.