Rails problem with select

A directory content:
$ ls -la
drwxr-xr-x 4 raw raw 4096 2006-11-14 00:00 .
drwxr-xr-x 5 raw raw 4096 2006-09-25 20:34 …
drwxr-xr-x 2 raw raw 4096 2006-10-25 08:57 200406
-rw-r–r-- 1 raw raw 7800 2006-11-01 09:40 ajer.gif
-rw-r–r-- 1 raw raw 2550 2006-11-01 09:37 ajer_mini.gif
drwxr-xr-x 2 raw raw 4096 2006-11-14 00:00 test

Under irb:
irb(main):001:0> Dir.foreach("./") {|f| (puts f) if File.directory?(f)}
.

200406
test
=> nil

Part of Rails application:
<% dirs = [] %>
<% Dir.foreach("./") {|f| dirs.push(f) if File.directory?(f) }%>
<%= select ‘photo’, ‘dirname’, dirs, :id => ‘photo_dirname’ %>

HTML generated by Rails application (here is the problem - no 200406
directory):

. .. test

This is only the example. I have added some more subdirectories to that
directory (i’ve used many different names - not only numbers). But I
received the same strange behaviour. There are only some of the
directories in ‘select’ element. irb still works correct and shows all
directories but not Rails generated HTML code.
Note, that without:
if File.directory?(f)
‘select’ has all files and directories existed in current directory.
Does anyone could tell me what I am doing wrong?
Please note that I’m going to put all directories existed in current
directory in ‘select’ element (all directories and only directories).

Thanks in advance

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs