TypeError: nil is not a symbol

前端 未结 2 980
情歌与酒
情歌与酒 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:09

    Ok I finally found the answer. I made the join table, 'entries' without an id field. This is require if using the join table as a model with extra data on it.

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题