JSON Array in Rails

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs