No commit activity in last 3 years
No release in over 3 years
Useful ActiveModel validators with ClientSideValidations support.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

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.

Validators

  • Different
  • Less
  • More
  • Associated
  • Credit Card

Installation

Bundler

Add on your Gemfile :

gem 'evelpidon_validators'

By hand

On the console :

gem install evelpidon_validators

On your code :

require 'evelpidon_validators'

Usage

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'

or

# 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

TODOs

  • 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.

Author(s)

Copyright

License

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