Custom Validator for “At Least One of” Fields

9875
0

A tiny custom validator keeps complex presence rules out of controllers. This example enforces that at least one of two fields is present (e.g., text content or an attachment).