我的参数如下:
{"utf8"=>"✓",
"authenticity_token"=>"...",
"consult_stat"=>
{"0"=>
{"employee_id"=>"1",
"consults"=>"7",
"signed"=>"8"},
"1"=>
{"employee_id"=>"2",
"consults"=>"5",
"signed"=>"6"}
},
"commit"=>"Submit Consultation Stats"}
如何使用动态密钥允许嵌套哈希?
答案 0 :(得分:0)
这很简单,你可以实现它
params.require(:consult_stat).permit(:employee_id,:consults,:signed)