On Sun, Oct 18, 2009 at 7:45 PM, Kevin M <[email protected]> wrote:

>
> 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
> -------------------------------------------------------------
> <h1>Register</h1>
>
> <% 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 %><br />
> <%= form.text_field :login %><br />
> <br />
> <%= form.label :password, form.object.new_record? ? nil : "Change
> password" %><br />
> <%= form.password_field :password %><br />
> <br />
> <%= form.label :password_confirmation %><br />
> <%= form.password_field :password_confirmation %><br />
>
>
> 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


> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to