How do I change
validates_numericality_of :test, :greater_than_or_equal_to=>0
into validate form
I tried only character and nil values. I need to check also it must be greater than 0
validate change_test
def change_test
if @test.nil?
errors.add_to_base('Hi Test should be only number')
end
end
and also I tried like this,
validate change_test
def change_test
if @test.nil?
errors.add_to_base('Hi Test should be only number')
else
if @test < 0
errors.add_to_base('The number should be greater than or equal to 0')
end
end
end
but it is result in error
Please help to solve this problem
thanks all