我正在使用带有设计的 client_side_validation gem,有类似的问题,但它没有帮助我,为什么我不能关闭 certrain 字段的验证?
这是我的代码
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :remote => true) do |f| %>
<%= f.email_field :email, :autofocus => true, class: 'login-form-fields span4', placeholder: "email", :validate => false %>
<%= f.password_field :password, class: 'login-form-fields span4', placeholder: "pass", :validate => {:presence => true} %>
<div><%= f.submit "Sign in", class: 'login-btn-submit' %></div>
<% end %>