Strong parameters require multiple

前端 未结 7 1646
广开言路
广开言路 2020-12-30 19:03

I\'m receiving a JSON package like:

{
  \"point_code\" : { \"guid\" : \"f6a0805a-3404-403c-8af3-bfddf9d334f2\" }
}

I would like to tell Rai

7条回答
  •  春和景丽
    2020-12-30 19:41

    This question came up in my google search for a different case ie, when using a "multiple: true" as in:

    <%= form.file_field :asset, multiple: true %>
    

    Which is a totally different case than the question. However, in the interest of helping out here is a working example in Rails 5+ of that:

    form_params = params.require(:my_profile).permit({:my_photos => []})
    

提交回复
热议问题