validates_inclusion_of :some_attribute,
:within => 1..1.0/0,
:message => 'should be positive'
here 1.0/0 it means infinity...
So the attribute is validate within positive. It is done in rails with validates_inclusion_of for numeric data.
hi, chirag
ReplyDeleteThanks for give me details about validate positive integer values in model in ruby.
Actully i m new to ruby.
Thanks