bcardarella/client_side_validations — Issue #221: errors on page when using validates_numericality_of
Author: innocentrifle
Created: 2011-11-10 11:14:58+00:00
State: open

when i use something like this in my model

======================================================

validates_numericality_of :sales_price, :greater_than => 0,
:allow_blank => true

validates_numericality_of :retail_price, :greater_than => 0,
:allow_blank => true

validates_numericality_of :sales_price, :less_than => :retail_price,
:if => Proc.new { |o| !o.retail_price.nil? } ,
:message => "can't be greater than retail price."

======================================================

i get such error in browser:

======================================================

Uncaught ReferenceError: retail_price is not defined

======================================================

How can i solve the problem?