Forum: Ruby on Rails problem with collect() method

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
brutyn_nick (Guest)
on 2005-11-24 12:27
(Received via mailing list)
hey, i have this code, for making a select list

@geotag = getting the rows from the database.

@geotag_options = [["All","%"]] + @geotag.collect {|g| [g.address1 + ",
" +
g.address2 + ", " + g.floor + ", " + + " (" + + ")"

normal display:
Street 12, Street 13, Bloc A, Ostend (Brutyn N.)

but when the address2 or floor is empty is it displayed:
Street 12, , , Ostend (Brutyn N.)

how can i fix that??

when i use other selecttags i cant select the current value (that from

can anyone help me?
This topic is locked and can not be replied to.