I just the Authlogic example working and I went to Register myself to create a user. When I did I got this error.
I just the Authlogic example working and I went to Register myself to
create a user. When I did I got this error.
2 errors prohibited this user from being saved
There were problems with the following fields:
Email is too short (minimum is 6 characters)
Email should look like an email address.
Views/Users/New.html/erb
Register
<% form_for @user, :url => account_path do |f| %>
<%= f.error_messages %>
<%= render :partial => “form”, :object => f %>
<%= f.submit “Register” %>
<% end %>
Views/Users/_form.erb
<%= form.label :login %>
<%= form.text_field :login %>
<%= form.label :password, form.object.new_record? ? nil : "Change
password" %>
<%= form.password_field :password %>
<%= form.label :password_confirmation %>
<%= form.password_field :password_confirmation %>
App/Controllers/UsersController
class UsersController < ApplicationController
before_filter :require_no_user, :only => [:new, :create]
before_filter :require_user, :only => [:show, :edit, :update]
def new
@user = User.new
end
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
def show
@user = @current_user
end
def edit
@user = @current_user
end
def update
@user = @current_user # makes our views "cleaner" and more
consistent
if @user.update_attributes(params[:user]) flash[:notice] = "Account updated!" redirect_to account_url else render :action => :edit end
end
end
Are there any other pages I should look into?
Thanks,
Kevin
Kevin, the following two validations failed for your model in question:
Email is too short (minimum is 6 characters)
Email should look like an email address.
Thus, what e-mail are you using for input and what does the validations
for the e-mail look like?
-Conrad
There is an input for login, password and password confirmation. I'm using my Gmail email so I'm confident it is correct and long enough.
I will check all my forms and pages are correct.
This is the new.html.erb: