Skip to content

how to add errors in nested objects #140

@MathieuDerelle

Description

@MathieuDerelle

lets use this example :

optional do
  array :tags, class: String
  hash :prefs do
    boolean :smoking
    boolean :view
  end
end

I'd like to use custom validation on :smoking
I'm doing this in the validate method
How to add an error on key ":prefs -> :smoking" ?
Is it possible with add_error ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions