0
我rails3.0.4,并制定有以下用户表设计的登录验证失败
create_table "users", :force => true do |t| t.string "login" t.string "email" t.string "crypted_password", :null => false t.string "password_salt", :null => false t.string "persistence_token", :null => false t.string "single_access_token", :null => false t.string "perishable_token", :null => false t.datetime "created_at" t.datetime "updated_at" t.string "database_authenticatable", :null => false t.string "recoverable" t.string "rememberable" t.string "trackable" t.string "reset_password_token" end
用户表不是由色器件创建的,但我添加了必要的 列在迁移安装。 按照在配置/初始化/ devise.rb
config.authentication_keys = [ :email]
但每次我尝试注册时,它抛出一个新的用户时间设置:
2 errors prohibited this user from being saved: Login is too short (minimum is 3 characters) Login should use only letters, numbers, spaces, and [email protected] please.
任何想法,为什么它会发生?
这就是日志从log/development.log中发现的日志
– Nozim 2011-03-05 13:05:30“Can not mass-assign protected attributes:login”。在app/models/user.rb中添加:登录到attr_accessible – 2011-03-05 13:11:54