使用 rails4 从前台获取参数,在 create 的时候出错,提示信息如下:
WARNING: Can't mass-assign protected attributes for XXX: name, spell_code, , insurance_number
app/controllers/XXXX_controller.rb:32:in `create'
(0.2ms) BEGIN
SQL (5.7ms) INSERT INTO "XXXX" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 25 Jul 2013 14:20:45 UTC +00:00], ["updated_at", Thu, 25 Jul 2013 14:20:45 UTC +00:00]]
保存到数据库时候,参数消失,只保存了 create update _at 两个信息, 折腾了一天了,崩溃 ing,求教各位大侠赐教@lgn21st @Rei