I’ve been trying to find the “right” way to do this and I’m now
the Rails masses.
I want to list all the directory names in a specific location and have
the directory names appear in a dropdown control for the user.
The Dir.entries(“somepath”) includes the “.” and “…” folders plus all
The Dir.glob() is hard for me to work with. I’m not familiar with that
of search. Part of my problem is that it seems the best fit but I’m not
how to make it work with any given directory path. It seems to work off
current one and I feared changing the current one and having odd bugs
concurrency issues arrise when the page is viewed more frequently and
different base directories are being searched.
So, what is the right rails way to do this?