我正在使用https://github.com/bcardarella/client_side_validations来验证我的注册表单。
我正在以这种形式验证用户名和电子邮件的唯一性:
validates_uniqueness_of :username, :email, :case_sensitive => false
唯一性的数据库验证在我的本地机器上进行得很好。但是当我在 Heroku 上尝试它们时,它们不起作用。
编辑:
这是注册表单(我正在使用设计):
<%= form_for @user, :as => :user, :validate => true, :url => user_registration_path do |f| %>
<div><%= f.label :name, :class => "signupin-label span-2" %><%= f.text_field :name, :class => "signupin-field last", :autocomplete => "off"%></div>
<div><%= f.label :username, :class => "signupin-label span-2" %><%= f.text_field :username, :class => "signupin-field last", :autocomplete => "off" %></div>
<div><%= f.label :email, :class => "signupin-label span-2" %><%= f.text_field :email, :class => "signupin-field last", :autocomplete => "off" %></div>
<div><%= f.label :password, :class => "signupin-label span-2" %><%= f.password_field :password, :class => "signupin-field last", :autocomplete => "off" %></div>
<div class="signupin-bl"><%= f.submit "Sign up", :id => "signUpButton" %></div>
<% end %>
我收到以下错误:
rails.validations.js:154
未捕获的类型错误:对象 (?-mix:^(a-zA-Z* ?| ([a-zA-Z0-9]+_?)*)$) 没有方法“测试”
有人可以指导吗?
谢谢!