How changes fields in acl9?

3 views
Skip to first unread message

alexander alyoshin

unread,
Mar 30, 2010, 11:17:02 AM3/30/10
to acl9-discuss
Need for user registration to use not only defaulted field, but also
their own.

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

Jason King

unread,
Mar 30, 2010, 1:18:11 PM3/30/10
to acl9-d...@googlegroups.com
`type` is a special field that rails itself will do things to for STI
- nothing to do with ACL9. Use a different name for a field if you're
not trying to setup an STI table.

> 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.

alexander alyoshin

unread,
Mar 30, 2010, 1:51:01 PM3/30/10
to acl9-discuss
Thanks! It's works!
Reply all
Reply to author
Forward
0 new messages