No commit activity in last 3 years
No release in over 3 years
Provides a form field validation JavaScript library for your Rails application. Built for use with jQuery and Twitter Bootstrap 3. Source code: https://github.com/nghuuphuoc/bootstrapvalidator
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.0

Runtime

 Project Readme

bootstrap-validator-rails (0.5.3)

Gem version of bootstrapvalidator JavaScript library = a jQuery based field validator for Twitter Bootstrap 3.

Source: https://github.com/nghuuphuoc/bootstrapvalidator

How to Use

Add into your Gemfile

gem 'bootstrap-validator-rails'

Add into your application.js

//= require bootstrapValidator.min

Add into your application.css

*= require bootstrapValidator.min

In your Rails directory run

bundle install

Together with Rails remote form

To use bootstrapValidator in a Rails remote form, you have to initialize the form validator like this:

$(form)
    .bootstrapValidator({
        ...
    })
    .on('success.form.bv', function(e) {
        // Called when the form is valid
        
        var $form = $(e.target);
        if ($form.data('remote') && $.rails !== undefined) {
            e.preventDefault();
        }
    });

Reference:

If you don't, your form will be submitted two times.