Rails strong params - using fields from has_many object

前端 未结 1 1446
渐次进展
渐次进展 2021-01-26 11:13

thanks a lot for your help.

In my rails project I have:

  • A location Model that has many :ads

相关标签:
1条回答
  • 2021-01-26 12:16

    All you need to use _attributes:

     params.require(:location).permit(:country, :location, {:ads_attributes => [:remote, :days]})
    
    0 讨论(0)
提交回复
热议问题