View Source ZoonkWeb.Shared.Validators (Zoonk v0.3.0-alpha)

Shared validators to be used with Ecto changesets.

Link to this section Summary

Functions

Validates a field doesn't contain spaces or special characters other than - and _.

Link to this section Functions

Link to this function

validate_slug(changeset, field)

View Source
@spec validate_slug(Ecto.Changeset.t(), atom()) :: Ecto.Changeset.t()

Validates a field doesn't contain spaces or special characters other than - and _.

It should also return an error for accented characters.