http://coldfusion.com logo
#cfwheels
Title
# cfwheels
a

Adam Cameron

03/04/2022, 11:07 AM
I am clearly blind. Where is the text for the validation failure messages, eg: I pass a non-date to a date property. I'm looking for a string like "must be a date" or even any string that looks like it might be part of a validation failure message.
n

neokoenig

03/04/2022, 11:14 AM
Copy code
validatesPresenceOf(properties="emailAddress", message="Yo, wassup with that email");
Copy code
validatesFormatOf(property="myAweomseDate", type="date", message="Booooooo");
a

Adam Cameron

03/04/2022, 11:26 AM
sorry, I was unclear
I mean I am trying to see what the message is for the default wheels validations
not how to set them for myself
reason: I want to use the same message text for my own validation as wheels itself would use for its automatic validation message
So if Wheels fails a date property validation with "it's not a date you fuckwit", then I want to use same
n

neokoenig

03/04/2022, 11:43 AM
So it's usually
[property] can't be something
https://api.cfwheels.org/v2.2/model.validatesPresenceOf.html i.e
[property] can't be empty
So in the date case it would just be
[property] is invalid
1
a

Adam Cameron

03/04/2022, 12:09 PM
Can't believe you missed out "fuckwit" from the error message. But so be it.
😃 1
Cheers! 😉
3 Views