Open
Description
My form:
class RegistrationForm < ActiveForm::Base
self.main_model = :user
attributes :email, :password
association :company do
attributes :name, :email, :phone
end
end
When I submit it with such params:
{
email: "", password: "", company_attributes: { name: "foo", email: ""}
}
Emails errors are:
@form.errors[:email]
=> ["Can't be blank", "Can't be blank"]
I find it weird that email errors are duplicated even if the fields have similar name.
Should we return a hash of errors to avoid it?
Metadata
Metadata
Assignees
Labels
No labels