DangerousAttributeError in OmniAuth Railscast Tutorial: create is defined by ActiveRecord

后端 未结 4 755
Happy的楠姐
Happy的楠姐 2021-01-18 01:25

I\'ve looked at ActiveRecord::DangerousAttributeError and other similar threads on SO, but they don\'t address the same issue.

I\'m following the omniauth tutorial:

4条回答
  •  无人及你
    2021-01-18 01:59

    I just ran into this following the same RailsCast.

    The tutorial says to run:

    rails g nifty:scaffold authentication user_id:integer \
            provider:string uid:string index create destroy
    

    But not having the nifty scaffold stuff on my machine, I just ran

    rails g scaffold authentication user_id:integer \
            provider:string uid:string index create destroy
    

    Which behaves differently. Instead of creating stub 'index', 'create', and 'destroy' controller methods, it created fields in the database.

    Remove them and it works fine, as mentioned previously.

提交回复
热议问题