On 10 Jan 2008, at 16:53, Atul Gupta wrote:
>
> Hi,
>
> 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
Fred
>
>
> Thanks
>
> atul
> --
> Posted via http://www.ruby-forum.com/.
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---