I am using Ruby on Rails 3 and I am trying join an array with the & character. I read the Ruby documentation about that.
join
&
My array is:
A slightly modified form of the answer you provided may be less computationally intensive, given the size of your array.
(['']+Array.wrap(classes)).join('&')
This works for whether classes is a type Array
classes
Array