Dominar Rails
Lightweight and highly configurable boostrap rails validator built on-top of Dominar.js.
Installation
Add this line to your application's Gemfile:
gem "dominar-rails"
And then execute:
$ bundle
Usage
Add the following to your app/assets/javascripts/application.js
:
//= require dominar-standalone.min
If you already have validator.js installed then just simply use:
//= require dominar.min
See the complete Dominar.js documentation
Demo Dominar.js documentation.
Example
var validator = new Dominar($('#new_user'), {
"user[name]": {
rules: 'required|min:3|max:10'
},
user[notes]: {
rules: 'required|min:5|max:20'
},
user[group]: {
rules: 'required|in:guest,admin'
}
});
Versions
The gem follows Dominar.js' versions. If the gem version is 1.0
, then 1.0
is the version of Dominar.js and 0
is the patch level of the gem itself.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request