form contains the following fields: name, password, confirmation and
mail. but I added another and the type of user. Why do I have time
while maintaining the type - is null?
migration:
------------------------------
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.column :login, :string, :null => false
t.column :email, :string, :null => false
t.column :type, :string, :null => false
t.column :crypted_password, :string, :null => false
t.column :password_salt, :string, :null => false
t.column :persistence_token, :string, :null => false
t.column :single_access_token, :string, :null => false
t.column :perishable_token, :string, :null => false
t.column :login_count, :integer, :null => false, :default => 0
t.column :failed_login_count, :integer, :null => false, :default
=> 0
t.column :last_request_at, :timestamp
t.column :current_login_at, :timestamp
t.column :last_login_at, :timestamp
t.column :current_login_ip, :string
t.column :last_login_ip, :string
end
end
def self.down
drop_table :users
end
end
controller:
------------------------------------------------------
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
and model:
-----------------------------------------------------
class User < ActiveRecord::Base
acts_as_authentic
end
> To unsubscribe from this group, send email to acl9-discuss
> +unsubscribegooglegroups.com or reply to this email with the words
> "REMOVE ME" as the subject.