You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to send an array of hash, I have the error instance of ActiveSupport::HashWithIndifferentAccess
Here is my model : expose :book, documentation: { type: Array[Hash] }
And in my controller I have nested attributes like this : requires :collection, type: Hash do optional :book, type: Array do requires :id, type: String requires :price, type: BigDecimal end end
When I check in my console the params book, I have an array with a hash : [{"id"=>"351a7eaf-cf93-4f89-9f3a-b2cce4c07a70", "amount"=>0.23e2}]
But it returns the error Collection::book(#11898309) expected, got {"id"=>"351a7eaf-cf93-4f89-9f3a-b2cce4c07a70", "amount"=>0.23e2} which is an instance of ActiveSupport::HashWithIndifferentAccess(#510440)
Do you know what's wrong here ?
The text was updated successfully, but these errors were encountered:
When I try to send an array of hash, I have the error
instance of ActiveSupport::HashWithIndifferentAccess
Here is my model :
expose :book, documentation: { type: Array[Hash] }
And in my controller I have nested attributes like this :
requires :collection, type: Hash do optional :book, type: Array do requires :id, type: String requires :price, type: BigDecimal end end
When I check in my console the params book, I have an array with a hash :
[{"id"=>"351a7eaf-cf93-4f89-9f3a-b2cce4c07a70", "amount"=>0.23e2}]
But it returns the error
Collection::book(#11898309) expected, got {"id"=>"351a7eaf-cf93-4f89-9f3a-b2cce4c07a70", "amount"=>0.23e2} which is an instance of ActiveSupport::HashWithIndifferentAccess(#510440)
Do you know what's wrong here ?
The text was updated successfully, but these errors were encountered: