Is there a summary anywhere of data entry form validation techniques for
Rails apps? I’ve come across lots of snippets of advice but they are all
so far-flung that it’s hard to sit down and organize an approach. The
kind of thing I’m looking for would be a simple list with entries like:
- simplest: Make sure your table model contains a line like
validates_presence_of :LoanID, :message => “is missing”
This will catch the error after the form is submitted by the user.
- Use DrySQL… (when does this catch the error?)
In other words, I’d like to see a summary of techniques for each type of
validation that can be applied to a data entry field. Then I (or the
rest of you!) will be able to pick and choose among the techniques which
are best for the particular situations at hand.
Maybe a full discussion of this calls for an article or even a whole
book, but all I’m looking for is a summary to help me decide among
techniques. The list would serve as a starting point for further
research into the techniques that seem best.
Can anyone help with this?