On 10 Jan 2008, at 16:53, Atul G. wrote:
Does RoR provide logical validation on the server side ? Eg checking
whether the amount in a particular field is the correct sum or product
of some other fields or if the value between 2 fields have some
relation, eg they are unequal etc. If there is an error, how is it
displayed, is a flash[:message] the best method ?
There are a bunch of validations you can use on your models
(validates_format_of, validates_inclusion_of etc…) and it’s not hard
to right your own/customise it.
error_messages_for is often a decent enough presentation of errors,
but you could also iterate over model.errors and display them whatever
way you want