forked from DavyJonesLocker/client_side_validations
-
Notifications
You must be signed in to change notification settings - Fork 0
Turn Off Client Side Validations Per Fieldset
Skieloch edited this page Aug 22, 2011
·
6 revisions
You can turn off validations for a given fieldset by passing :validate => false for the nested resource.
<%= form_for @user, :validate => true do |user| %>
<%= user.label :email %>
<%= user.text_field :email %>
<%= user.fields_for :address, :validate => false do |address| %>
<%= address.label :street %>
<%= address.text_field :street # won't run validations %>
<%= address.label :street %>
<%= address.text_field :city # won't run validations %>
<% end %>
<%= user.submit 'Submit' %>
<% end %>This can be used by any formbuilder:
Formtastic
<%= user.semantic_fields_for :address, :validate => false do |address| %>SimpleForm
<%= user.simple_fields_for :address, :validate => false do |address| %>