我有这个表格部分:
.row
.span6
.well
%h2 Sign in
= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => 'form-vertical' }) do |f|
= f.input :email, :autofocus => true, :wrapper => :bootstrap_placeholder
= f.input :password, :wrapper => :bootstrap_placeholder
= f.input :remember_me, :as => :boolean if devise_mapping.rememberable?
= f.button :submit, "Sign in", :class => 'btn-primary'
= render "devise/shared/links"
.span6
.well
%h2 Sign up
= simple_form_for(resource, :as => resource_name, :url => regi stration_path(resource_name), :html => {:class => 'form-vertical' }) do |f|
= f.error_notification
= display_base_errors resource
= f.input :name, :autofocus => true
= f.input :email, :required => true
= f.input :password, :required => true
= f.input :password_confirmation, :required => true
= f.button :submit, 'Sign up', :class => 'btn-primary'
= render "devise/shared/links"
并且它工作正常,但问题来自验证,当我想在不输入任何数据的情况下注册用户时......显示错误消息,但它也突出显示登录表单的用户名和密码字段..有没有办法避免这种验证混淆?