Rails 4中有以下参数:
{"delivery_time":"10","delivery_type_id":"1","order_items":[{"count":"5","item_id":"1"}],"order_status_id":"1","user_id":"1","action":"create","controller":"api/v1/orders"}
有以下强烈的参数:
params.permit(:user_id,:order_status_id,:delivery_type_id,:delivery_time,order_items:[])
解决方法
您可以包含嵌套数组,例如它将是:
params.permit(:user_id,order_items: [:count,:item_id])
其他人可以在这里找到更多 – http://edgeapi.rubyonrails.org/classes/ActionController/StrongParameters.html