how to permit an array with strong parameters

前端 未结 5 490
说谎
说谎 2020-11-22 13:50

I have a functioning Rails 3 app that uses has_many :through associations which is not, as I remake it as a Rails 4 app, letting me save ids from the associated model in the

5条回答
  •  一生所求
    2020-11-22 14:22

    It should be like

    params.permit(:id => [])
    

    Also since rails version 4+ you can use:

    params.permit(id: [])
    

提交回复
热议问题