I'm attempting to concatenate a string to an array value. Since the URL/domain is the same, I simply store the users email prefix and append the url/domain. I need to export the full email address out to CSV:
CSV.generate(options) do |csv|
columns = %w(name, email_address)
url = "@example.com"
all.each do |location|
csv << location.attributes.values_at(*columns) + [url]
end
end
Currently the resulting output is:
Joe, user1, @example.com
Bob, user2, @example.com
What I need is:
Joe, [email protected]
Bob, [email protected]
How can I achieve the above?
csv << [location.name, "#{location.email_address}@example.com"]should work.