Skip to content

Instantly share code, notes, and snippets.

diff --git a/lib/simple_form/components/errors.rb b/lib/simple_form/components/errors.rb
index 92c10b5..f540eaf 100644
--- a/lib/simple_form/components/errors.rb
+++ b/lib/simple_form/components/errors.rb
@@ -32,7 +32,11 @@ module SimpleForm
end
def errors_on_attribute
- object.errors[attribute_name]
+ if object.respond_to?(:errors)