# Drop down menu to show directories

**URL:** <https://www.ruby-forum.com/t/drop-down-menu-to-show-directories/147326>\
**Category:** Rails\
**Created:** [August 31, 2008, 5:30am UTC](https://www.ruby-forum.com/t/drop-down-menu-to-show-directories/147326 "2008-08-31T05:30:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![toro04](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ea5d25/32.png) [@toro04](https://www.ruby-forum.com/u/toro04)\
**Post date:** [August 31, 2008, 5:30am UTC](https://www.ruby-forum.com/t/drop-down-menu-to-show-directories/147326/1 "2008-08-31T05:30:47Z")

</div>

Hi Guys,

Can anyone recommend a way to have a drop down menu that show a list of  
directories?

In my controller I have:  
@files = [Dir.glob(’/mydirectoryofcoolfiles/\*’)]

Then the form I am unsure of how to do it:  
\<%= f.collection\_select :job\_id, @files, :id, :job\_title, :prompt =\>  
“Select a shot” %\>

The app has a directory with lots of ‘job’ directories in it.  
Each job folder has a number of ‘asset’ folders in it.

I want the user to select a ‘job’ in a dropdown menu, and then a second  
menu lists the folders in that particular folder

any ideas?

Thanks

Adam
