I have a Ruby on Rails model
This should be validated. It must be validated so that:
- The values are correctly formatted. E.g. 48.8582 and 2.2945 but also 48.8 and 2.2. Any precision should be allowed. I store them as Float, any addtitional validation needed or advised?
- They are within valid ranges (0-90). Or should I allow negative numbers, or numbers above and below 90?
I am not interested in whether on this point is an actual valid address (sea, northpole, whatever, as long as it is a valid point on earth).
I am using geocoder gem, but for now, input is simply a pair of lat/lon textfields. Geocoder is merely of interest for this question because it may have utility-methods (which I cannot find) to validate a lat/long pair.