Skip to content
This repository

Formtastic plugin for ClientSideValidations

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 coffeescript
Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 vendor
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 CONTRIBUTING.md
Octocat-spinner-32 Gemfile
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 client_side_validations-formtastic.gemspec
README.md

This library is no longer being maintained. Use at your own risk

ClientSideValidations-Formtastic

Build Status Dependency Status Code Climate

Formtastic plugin for ClientSideValidations

Installation

In your Gemfile add the following:

gem 'formtastic'
gem 'client_side_validations'
gem 'client_side_validations-formtastic'

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

Follow the remaining installation instructions for ClientSideValidations

Add the following line to app/assets/javascripts/application.js

//= require rails.validations.formtastic

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

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

Per-input options are done with :validate

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

Authors

Brian Cardarella

We are very thankful for the many contributors

Versioning

This gem follows Semantic Versioning

Major and minor version numbers will follow Rails's major and minor version numbers. For example, client_side_validations-formtastic-2.2.0 will be compatible up to ~> formtastic-2.2.0

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

@dockyard

Licensed under the MIT license

Something went wrong with that request. Please try again.