Skip to content
mhenrixon edited this page Apr 20, 2011 · 14 revisions

ClientSideValidations supports Formtastic.

Example:

<%= semantic_form_for @book, :validate => true do |book| -$>

Turn off validation per input

If you want to turn off the validation for a particular input you have to use the :input_html syntax for Formtastic:

= semantic_form_for @user, :validate => true do |user|
  = user.input :email
  = user.input :username, :input_html { :validate => false }

Turn off validation for all fields

If you want to turn off the validation for an association you just create a fields for and set the validate to false:

= semantic_form_for @user, :validate => true do |user|
  = user.input :email
  = user.semantic_fields_for :address, :validate => false do |address|
    =address.input :street # won't be validated regardless
    =address.input :city   # won't be validated regardless