Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Formtastic plugin for ClientSideValidations
JavaScript Ruby CoffeeScript
Tag: v2.0.0.beta.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
gemfiles
lib/client_side_validations
test
vendor/assets/javascripts
.gitignore
.travis.yml
Gemfile
README.md
Rakefile
client_side_validations-formtastic.gemspec

README.md

ClientSideValidations-Formtastic

Build Status

Formtastic plugin for ClientSideValidations

Installation

In your Gemfile add the following:

gem 'formtastic'
gem 'client_side_validations'
gem 'client_side_validations-formtastic', :require => '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.

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

Versioning

This gem follows Semantic Versioning

Major and minor version numbers will follow Formtastic's major and minor version numbers. For example, client_side_validations-formtastic-2.0.0 will be compatible with ~> formtastic-2.0.0

Want to help?

Stable branches are created based upon each minor version. Please make pull requests to specific branches rather than master.

Please make sure you include tests!

Unles Rails drops support for Ruby 1.8.7 we will continue to use the hash-rocket syntax. Please respect this.

Don't use tabs to indent, two spaces are the standard.

Legal

DockYard, LLC © 2012

@dockyard

Licensed under the MIT license

Something went wrong with that request. Please try again.