Difference between revisions of "Validations"
Jump to navigation
Jump to search
(No difference)
|
Latest revision as of 13:09, 2 May 2006
We need to validate user-input. One idea is to do it the Rails-way, that way, or model might look something like this:
class User { public boolean validate() { validatePresenceOf("name"); // a name is mandatory validateFormatOf("date", "\d\d\-\d\d\-\d\d\d\d"); // a date must follow this format } }