0.01
No commit activity in last 3 years
No release in over 3 years
format & validate chilean R.U.T.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
 Project Readme

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