Is there a cleaner way to do something like this?
%w[address city state postal country].map(&:to_sym) #=> [:address, :city, :state, :postal, :country] >
The original answer was written back in September '11, but, starting from Ruby 2.0, there is a shorter way to create an array of symbols! This literal:
%i[address city state postal country]
will do exactly what you want.