How to permit arrays with hash in Rails 4?

Viewed 17335

There is the following params in 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"}

There is the following strong params:

params.permit(:user_id, :order_status_id, :delivery_type_id, :delivery_time, order_items:[])

But this code returns hash without 'order_items' array. I think the reason is hash in array. Please, tell me, how can I fix it? Thanks in advance

2 Answers
Related