Client-side validation does not work in production, but works in development

This is my model User:

class User < ActiveRecord::Base
    rolify
  devise :database_authenticatable, :registerable, :token_authenticatable, :confirmable, :timeoutable, 
         :recoverable, :rememberable, :trackable, :validatable,
                 :email_regexp =>  /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i

  attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :confirmed_at, :confirmation_token
    validates_uniqueness_of :email, :case_sensitive => false
    validates_confirmation_of   :password

end

Gemfile:

gem 'client_side_validations'

the form:

<%= form_for(resource, :as => resource_name, :class => "send-with-ajax", :url => user_registration_path(resource), :validate => true, :html => { :id => 'user_new' }) do |f| %>
              <%= f.text_field :email,:placeholder => "your-email@address.com", :input_html => {:autofocus => true}, :validate => true %>
              <%= f.submit :label => "Submit", :value => "Sign Me Up!"  %>
      <div class="ajax-response"><%= devise_error_messages! %></div>
          <% end %>

It should work when you exit the field, here is a screenshot that it works locally:

client_side_validation local

But when I do this during production, it doesn’t work at all, and I don’t see errors in the log file or in the JS console.

Edit 1:

Verification messages are not displayed.

In Heroku logs, I see this when I try to use a "valid" email address:

2012-06-10T18:44:55+00:00 app[web.1]: Started GET "/validators/uniqueness?case_sensitive=false&user%5Bemail%5D=abc%40tell.com" for xx.xxx.xx.x2 at 2012-06-10 18:44:55 +0000
2012-06-10T18:44:55+00:00 heroku[router]: GET myapp.heroku.com/validators/uniqueness?case_sensitive=false&user%5Bemail%5D=abc%40tell.com dyno=web.1 queue=0 wait=0ms service=221ms status=404 bytes=4

But he does not show me a message on my page how this happens locally.

, , , HTTP- - , "" , abc@email.com. - abc, , - invalid address - .

2:

production mode, , Heroku. , , Heroku - .

HTML, :

<form accept-charset="UTF-8" action="/users" class="formtastic user" data-validate="true" id="user_new" method="post" novalidate="novalidate"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="kQid^%&^%jhgdsjhgfxmw4=" />
              <input data-validate="true" id="user_email" input_html="{:autofocus=&gt;true}" name="user[email]" placeholder="your-email@address.com" size="30" type="text" />
              <input label="Submit" name="commit" type="submit" value="Sign Me Up!" />
</form><script>window['user_new'] = {"type":"Formtastic::FormBuilder","inline_error_class":"inline-errors","validators":{"user[email]":{"presence":{"message":"can't be blank"},"uniqueness":{"message":"has already been taken","case_sensitive":false},"format":{"message":"is invalid","with":/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i,"allow_blank":true}}}};</script>               </div>

3:

application.js:

//= require jquery
//= require jquery_ujs
//= require rails.validations
//= require_tree .

application.html.erb JS application.js

4:

, , JS script, client_side_validation, , id user_email, user[email]. id user[email], .

- ?

+5

All Articles