Hey everyone,
I am playing around with the formal library and I was wondering what was the recommanded way to add an error message to a specifi action.
For example how could I add "password must be at least 3 characters" ?
I tried to look at the language function but that doesn't seem very ergonomic ?
fn signup_form() -> Form(Signup) {
form.new({
use email <- form.field("email", {
form.parse_email
})
use password <- form.field("password", {
form.parse_string
|> form.check_string_length_more_than(3) // how can I add a specific error
// message if this guard is failing ?
})
use _ <- form.field("confirm", {
form.parse_string
|> form.check_confirms(password)
})
SignUp(email: email, password: password)
})
}