从 Ruby 1.9.3 上的 Rails 3.2.13 升级到 Rails 4.0.0。
设计 3.0.0.rc 不会批量分配。我遵循了我发现的所有建议,从这里描述的两种方法开始:https ://github.com/plataformatec/devise#strong-parameters 。
登录/注销有效,但注册无效:
Started POST "/users" for 127.0.0.1 at 2013-07-03 21:01:47 -0500
Processing by RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓",
"authenticity_token"=>"5QPwkbXULEsF5nCiMMK7zd04baZ5kOecgqV2BdRnSEc=",
"user"=>{"first_name"=>"test", "last_name"=>"testor", "email"=>"asdhd@gmail.com",
"username"=>"testy", "password"=>"[FILTERED]",
"password_confirmation"=>"[FILTERED]"}, "commit"=>"Register"}
WARNING: Can't mass-assign protected attributes for User: email, password,
password_confirmation, first_name, last_name, username
这是设计的问题吗?有人有解决方案吗?
谢谢!