AuthLogic 예제에 따라 AuthLogic for Rails를 설정합니다 : http://github.com/binarylogic/authlogic_example.AuthLogic 양식에서 잘못된 유효성 검사 오류가 발생합니다 - 이유는 무엇입니까?
내가 시스템에 성공적으로 로그온 할 수 있지만, 새로운 사용자를 등록/new.html.erb 사용자를 액세스 할 때는 다음과 같은 유효성 검사 오류를 반환: 이러한 오류의
Email is too short (minimum is 6 characters)
Email should look like an email address.
Login is too short (minimum is 3 characters)
Login should use only letters, numbers, spaces, and [email protected] please.
Password is too short (minimum is 4 characters)
Password confirmation is too short (minimum is 4 characters)
없음에 존재하지를 내가 입력하는 데이터.
# new.html.erb
<%= form.label :login, nil, :class => "label" %><br />
<%= form.text_field :login, :class => "inputBox",
:name => "login", :type => "text" %><br />
<%= form.label :password, form.object.new_record? ? nil : "Change password", :class => "label" %><br />
<%= form.password_field :password, :class => "inputBox",
:name => "password", :type => "text" %><br />
<%= form.label "Confirm password", nil, :class => "label" %><br />
<%= form.password_field :password_confirmation, :class => "inputBox",
:name => "password_confirmation", :type => "text" %><br />
<%= form.label :email, nil, :class => "label" %><br />
<%= form.text_field :email, :class => "inputBox",
:name => "email", :type => "text" %><br />
# Users controller
def new
@user = User.new
render :layout => "forms"
end
데이터가 어떻게 든 전송되지 않으므로 AuthLogic이 입력이 충분하다고 생각하지 않는다고 생각합니다. AuthLogic이 데이터가 유효성 검사를 만족시키지 못한다고 말하는 이유를 알고 있습니까?
------ 더 많은 정보는 ------
# User model
class User < ActiveRecord::Base
acts_as_authentic
belongs_to :authenticable, :polymorphic => true
end
# Users controller, def create:
def create
@user = User.new(params[:user])
if @user.save
flash[:notice] = "Account registered!"
redirect_back_or_default account_url
else
render :action => :new
end
end
생성 작업 및 사용자 모델 코드에 대한 코드를 추가 할 수 있습니까? 루비 콘솔을 통해 사용자를 생성하고 오류가 있는지 확인하십시오. 그리고 하나 – Vamsi