Fetching contributors…
Cannot retrieve contributors at this time
104 lines (70 sloc) 2.67 KB

Evelpidon Validators (for Rails / ActiveModel / ActiveRecord)

Project Status Build Status

Collection of various ActiveModel validators, alongside their client side implementation as ClientSideValidations::Middleware (see ClientSideValidations for more info). Client side validations are optional and are enabled only if the client_side_validations gem is already loaded.


  • Different
  • Less
  • More
  • Associated
  • Credit Card



Add on your Gemfile :

gem 'evelpidon_validators'

By hand

On the console :

gem install evelpidon_validators

On your code :

require 'evelpidon_validators'


Validators are not automatically loaded. You can require the validators you need either explicitly one-by-one or all of them. So for example :

# Load only "Greater than" and "Less than" validators :
require 'evelpidon_validators/greater'
require 'evelpidon_validators/less'


# Load everything
require 'evelpidon_validators/all'

Enable client side validations support

Client-side validations work out of the box with Rails 3.1 (through the asset pipeline) :

  • Configure / initialize ClientSideValidations (gem, js, etc...) per it's documentation.
  • Require the 'evelpidon_validators' js. This will be served through the asset pipeline

So for example the following should work :

//= require rails.validations
//= require evelpidon_validators


  • Better documentation
  • Gather other useful validations found around the net...

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally (not really...).
  • Commit, do not mess with gemspec, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send a pull request. Bonus points for topic branches.




Evelpidon Validators are released under the MIT license. See LICENSE for more details.