Skip to content

Numerico/rut-chileno

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rut-chileno

ruby gem to validate and format chilean R.U.T.

install as ruby gem

	$ gem install rut_chileno

or add to Gemfile in Ruby on Rails

	gem 'rut_chileno'

then

	$ bundle install

One example use could be in a validator class

class RUTValidator < ActiveModel::Validator
  require 'rut_chileno'
  def validate(record)
    unless RUT::validar(record.rut)
      record.errors[:rut] << I18n.t(:invalid_rut)
    end
  end
end

which is then referenced from a model

class Person < ActiveRecord::Base
  validates_with RUTValidator
end

but let your imagation fly


based on jQuery library by Joaquin Nuñez

http://joaquinnunez.cl/jQueryRutPlugin/


RUT Chileno is Free Software licensed under the Peer Production License

Licencia de Producción de Pares

About

ruby gem to validate and format chilean R.U.T.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages