Tuesday, 15 March 2011

ruby on rails - How do I add an array of records at the beginning of another array of records? -


There are two arrays of my database records.

I want to add another first beginning.

I looked at the insert on a specific index, but before that it would be the result of putting another array inside one.

This is not possible, but thanks in advance for any help.

How is it?

  array2 = [1,2,3] array 1 = [11,21] array2 + array1 # = & gt; [1, 2, 3, 11, 21]    

No comments:

Post a Comment