>> params['UserAttr']['3'] => {"op"=>"+=", "type"=>"check", "value"=>"cd", "user_id"=>1, "attribute_id"=>"42"} >> attribute = UserAttr.new(params['UserAttr']['3']) ActiveRecord::AssociationTypeMismatch: Attribute expected, got Array +--------------+-----------------------+------+-----+---------------------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+-----------------------+------+-----+---------------------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | user_id | int(11) | NO | MUL | NULL | | | attribute_id | int(11) | NO | MUL | NULL | | | op | varchar(2) | NO | | NULL | | | value | varchar(253) | NO | | NULL | | | created_on | timestamp | YES | | 0000-00-00 00:00:00 | | | updated_on | timestamp | YES | | CURRENT_TIMESTAMP | | | type | enum('reply','check') | NO | | NULL | | +--------------+-----------------------+------+-----+---------------------+----------------+