1
的不確定的「添加」我有一項sign_up形式這樣無法調用Rails中的客戶端驗證寶石
<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 %>
我使用客戶端驗證的寶石,以驗證客戶端上。當我從那些瀏覽器的javascript控制檯中出現以下錯誤時重點關注。
Uncaught TypeError: Cannot call method 'add' of undefined
Uncaught TypeError: Cannot call method 'remove' of undefined
請幫我解決這個問題.. 謝謝。