append to array rails code example Example: ruby push array array = [1, 2, 3, 4] array.push(5) array # => [1, 2, 3, 4, 5]