我有一个像这样的设计注册表格
<h2>Sign up</h2>
<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :validate => true) do |f| %>
<%= devise_error_messages! %>
<div><%= f.text_field :name, :validate => { :presence => true }, :placeholder => 'Full Name' %></div>
<div><%= f.email_field :email, :validate => { :presence => true }, :placeholder => 'Email address ' %></div>
<div><%= f.password_field :password, :validate => { :presence => true }, :placeholder => 'Password' %></div>
<div><%= f.password_field :password_confirmation, :validate => { :presence => true }, :placeholder => 'Confirm Password' %></div>
<%= f.check_box :terms_of_service %>
<%= f.button :submit, "Next" %>
<% end %>
我使用客户端验证 gem 在客户端进行验证。当我从这些中的每一个中集中注意力时,浏览器的 javascript 控制台中会出现以下错误。
Uncaught TypeError: Cannot call method 'add' of undefined
Uncaught TypeError: Cannot call method 'remove' of undefined
请帮我解决这个问题。谢谢。