0 like 0 dislike
1 view
in ROR by anonymous Bilge (165k points)
rails array convert to json with label

1 Answer

0 like 0 dislike
by anonymous Bilge (165k points)
data = @users.map { |n| { name: n } }
render json: data # works
[{"name":"zax@ger.com"},{"name":"zxc@ter"}]

...