JSON Array in Rails


#1

i created this JSON in Rails with “render json:”
[{“id”:1,“name”:“Test1”,“set”:“A”}]

but the right JSON is
{“my”:[{“id”:1,“name”:“Test1”,“set”:[“1”,“2”]}]}

How can i add “my” as a hash?

How can i create a array in database with the “set” array?

Thanks.