Find files in directory


For my rails program I need to be able to look in a folder for an image file and then display the file name and image on screen.

I was wondering if it is possible to do that, and how the best way to do it would be?

Thanks a lot, Rob

Build a non-active record model that can looks thru the files in the directory, then handle whatever you need to do. Once you have the location of the file it shouldn't be difficult to show it. Best if the folder of images is in the public directory.


The images would be placed in the public directory. I am just unsure how to code this, would I need to use dir.each or something along those lines?