Question: How can I create an array with Ruby (on Rails) in this form:

```
[[0,5], [1,5], [3,7]]

```

Edit: 
I know how to define simple array and add some data:

```
posts = Array[] # or Array.new
posts << data.id # e.g. posts[1,2,3,4]

```

BUT i wanna know how to add (push) data to the array that is more complexive like in first array [[],[]]. 

Try to understand me, please. :)

Answer: 
`num = [[0,5], [1,5], [3,7]]` isn't working?
There is a lot of ways to resolve your issue. You're looking for an array of arrays. I think you're confused by how an array can be inside an array. You should keep in mind that an array is just an ordered list of objects. So storing in array in each index is not as foreign as a concept as it may seem.

```
A = [] #an empty array
A[0] = [1, 2]
A[1] = 1
A # => [[1,2], 1]

```

If you want to initialize an array with a default value as an array try

```
A = Array.new(2) {Array.new(2){0}} #This creates an array of size 2 with default values of arrays of size 2 with 0 in each entry.

A[0][1] # returns 0
A[0] # returns [0, 0]
A #returns [[0,0], [0,0]]

```