README.md in phony_rails-0.0.4 vs README.md in phony_rails-0.0.5

- old
+ new

@@ -1,7 +1,9 @@ -# PhonyNumber +# PhonyRails +(In its early days :) called PhonyNumber) + This Gem adds useful methods to your Rails app to validate, display and save phone numbers. It uses the super awesome Phony gem (https://github.com/floere/phony). ## Installation @@ -24,12 +26,16 @@ class SomeModel < ActiveRecord::Base phony_normalize :phone_number, :default_country_code => 'US' # Normalizes the attribute itself phony_normalized_method :fax_number # Creates method normalized_fax_number that returns the normalized version of fax_number end +The `:default_country_code` options is used to specify a country_code when normalizing. + +PhonyRails will also check your model for a country_code method to use when normalizing the number. So `'070-12341234'` with `country_code` 'NL' will get normalized to `'317012341234'`. + Use the Phony.plausible method to validate an attribute: - validate :phone_number, :phony_number => true + validate :phone_number, :phony_plausible => true In your views use: <%= "some number string variable".phony_formatted(:format => :international, :spaces => '-') %>