Hi i use the Devise gem and want to use Client_side_validation
i install gem and put
//= require rails.validations
in to my assets/javasctipt/application.js
and in the form i add
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :validate => true ) do |f| %>
I thought thats all i need to do …
but when i unfocus my fild – nothing happens ( i got one warning in my fire bug ) ->
TypeError: settings is undefined
.live('focusout', function() { $(this).isValid(settings.validators); })
does not work
where i have mistake?
Same issue, investigating.
On my side, it seems that the js exported by client-side-validation, which in my case is
window['user_new']doesn’t match the id of the form
new_userSo when rails.validation.js try to get the data
var settings = window[form.attr('id')];it fails.
[EDIT]
In the devise view, replacing
by
fixes it for me!
Not really sure why the
:as => resource_nameinvert the name of the resource though ?