forked from DavyJonesLocker/client_side_validations
-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
wxjaqy edited this page Apr 7, 2012
·
7 revisions
To start using client_side_validations you need to be using jQuery
- Add
rails.validations.jsto your layout
<%= javascript_include_tag 'jquery', 'rails' 'rails.validations' -%>- Tell a form that you want to turn on validations
<%= form_for @person, :validate => true do |person| -%>ClientSideValidations only works within the context of a form builder. So using the form_tag method will not work.
Also, while ClientSideValidations supports nested fields it will only work with the form builder's fields_for method, not the stand alone.