Need a feature for customizing error message.

i.e. in string type, match constraint will return error message "must match the pattern %{regex}". But, showing regex in user interface is not a good experience for users. I need to customize error messages.
3 Replies
frankdugan3
frankdugan3•2y ago
Zach already gave the OK on adding that feature: https://discord.com/channels/711271361523351632/712035333432147989/1088140734634401935 I got sidetracked on it though, would be good if you could put together an issue for it so we can track the feature. 😄
ZachDaniel
ZachDaniel•2y ago
In the meantime you can remove the constraint from the attribute and add the validation: validate match(:field, ~r//), message: "must be a valid something"
rapidfsub
rapidfsubOP•2y ago
Oh, I missed validations feature in resource. I'll use it for now. Thanks.

Did you find this page helpful?