Ruby on Rails - Randomize JSON variable and apply in Array

Asked

Viewed 272 times

0

Guys, I’m having a problem that’s relatively simple, but it’s killing me.

I have an array of JSON objects. This array of objects will compose another array of containing other n arrays.

So far so good. However, what happens is that at each iteration I randomize the attribute "value" and put the object in this new array. And when I see, at the end of the iterations, all objects have the same value (that of the last Random).

Can someone help me?

Código Resultado

  • Instead of an image post the code directly in the question.

1 answer

1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.