Ruby on Rails Couplapse Array

your_array.flatten(level)
Nimorum