Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Collection of various ActiveModel validators, alongside client side implementation as ClientSideValidations::Middleware.
Ruby JavaScript
Tag: v0.1.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
CHANGELOG.md
Gemfile
LICENSE
README.md
Rakefile
evelpidon_validators.gemspec

README.md

Evelpidon Validators (for Rails / ActiveModel / ActiveRecord)

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

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/greater'

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.

Something went wrong with that request. Please try again.