Skip to content
SimpleForm plugin for ClientSideValidations
Branch: master
Clone or download
Latest commit 9bcd1b9 Apr 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
coffeescript
gemfiles Add support to CSV 14.0 Apr 23, 2019
lib/client_side_validations Update version and changelog Apr 23, 2019
test Test against jQuery 3.4.0 by default Apr 23, 2019
vendor/assets/javascripts
.gitignore Ignore yarn-error.log Apr 13, 2018
.rubocop.yml Disable Style/IfUnlessModifier cop Nov 3, 2018
.travis.yml Add support to CSV 14.0 Apr 23, 2019
Appraisals Add support to CSV 14.0 Apr 23, 2019
CHANGELOG.md Update version and changelog Apr 23, 2019
CONTRIBUTING.md
Gemfile
LICENSE.md Update License Feb 1, 2019
README.md Update License Feb 1, 2019
Rakefile Fix RuboCop offences Apr 13, 2018
client_side_validations-simple_form.gemspec Add support to CSV 14.0 Apr 23, 2019
coffeelint.json
package.json Add Bootstrap 4 support Sep 9, 2018

README.md

ClientSideValidations-SimpleForm

Gem Version Build Status Code Climate Coverage Status

SimpleForm plugin for ClientSideValidations

Installation

In your Gemfile add the following:

gem 'simple_form'
gem 'client_side_validations'
gem 'client_side_validations-simple_form'

Order matters here. SimpleForm and ClientSideValidations need to be required before ClientSideValidations-SimpleForm.

Follow the remaining installation instructions for ClientSideValidations

According to the web framework you are using, add one of the following lines to app/assets/javascripts/application.js

// No framework / Generic frameworks / Bootstrap 3
//= require rails.validations.simple_form

// Bootstrap 4
//= require rails.validations.simple_form.bootstrap4

Again, order matters. You should add this line after the require for rails.validations as described in the ClientSideValidations installation instructions.

If the asset pipeline is disabled the asset file will be copied into public/javascripts when the ClientSideValidations install generator is run.

At any time you can copy the asset file into your project by running:

rails g client_side_validations:copy_assets

If the asset pipeline is disabled the asset file will be copied into public/javascripts. Otherwise the asset file will be copied into app/assets/javascripts (or whatever asset directory you have defined)

Usage

The usage is the same as ClientSideValidations, just pass validate: true to the form builder

<%= simple_form_for @book, validate: true do |book| %>
  <%= book.input :name %>
<% end %>

Per-input options are done with :validate

<%= book.input :name, validate: { presence: true, uniqueness: false } %>

Authors

Brian Cardarella

Geremia Taglialatela

We are very thankful for the many contributors

Versioning

This gem follows Semantic Versioning

Want to help?

Please do! We are always looking to improve this gem. Please see our Contribution Guidelines on how to properly submit issues and pull requests.

Legal

DockYard, LLC © 2012-2019

@dockyard

Licensed under the MIT license

You can’t perform that action at this time.