TypeError: nil is not a symbol

前端 未结 2 1000
情歌与酒
情歌与酒 2021-01-17 11:54

Simply trying to save with ActiveRecord and it I keep getting \"TypeError: nil is not a symbol\"

if card_data[:card] and card_data[:deck]
  e = self.find_or_         


        
2条回答
  •  独厮守ぢ
    2021-01-17 12:13

    For those of you coming here and needing to add the primary key, you can do it in a migration like this:

    class AddIdToMyTable < ActiveRecord::Migration def change add_column :my_table, :id, :primary_key end end

提交回复
热议问题