using ActiveRecord to populate an array

You could probably just:

CURRENCIES = Currency.find(:all).map { |x| ["#{x.name} (#{x.symbol})", x.id] }

You almost certainly don't want to use an instance variable (@temp) where a local variable (temp) would do, but all you were really missing in your first post was the .each on the result of your find(:all)

-Rob

Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com

For the UTF-8, are you doing:

$KCODE = 'UTF8' require 'jcode'

Then this should work: CURRENCIES = Currency.find(:all).map do |x|    [ "%s%*s %s".%([x.symbol, 4-x.symbol.jlength, '-', x.name]), x.id ] end

look at String#% or Kernel.sprintf for the formatting details

This may not work if your UTF-8 characters are of varying display widths in your browser font anyway, but it might be close enough.

-Rob

Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com

Rails 1.2 includes multibyte chars support:

x.symbol.chars.length

jeremy