Client side validations are working perfectly on my other simple_forms. Code I am using in other forms is:
<%= simple_form_for @group, :validate => true , :html => { :class => 'form-horizontal' } do |f| %>
In Case of devise sign up form, Code is:
<%= simple_form_for(resource, :validate => true, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
I even tried:
<%= simple_form_for(@user, :validate => true, :url => registration_path(resource_name)) do |f| %>
But its not working 🙁
My Gem file is:
gem 'simple_form'
gem "client_side_validations"
gem 'client_side_validations-simple_form'
Versions:
client_side_validations (3.2.0)
client_side_validations-simple_form (2.0.0)
client_side_validations (~> 3.2.0)
simple_form (~> 2.0.3)
Any suggestions?
First, I would recommend upgrading to client_side_validations 3.2.1, which is about a month old, even though I don’t see any devise-specific bugfixes in this release.
Second, they are both great packages, but know that the history between devise and client_side_validations has been fraught with incompatibilities. Look through this search in the closed issues for csv to get a sense.
Third, make sure you check out this page in the docs, which explains how to work around a javascript incompatibility with the email validation regex.
Finally, look through this new example application to make sure you are following the same patterns and practices.