Trying to get the files in a directory structure to be read into a
variable. Just playing around right now but would like it so that each
file read gets entered into a database. Trying to read a folder of music
files. I put the folder in the public folder along with the images, and
stylesheet. Added this code to my controller:
@files = Dir['/public/music/']
@mp3 = @files.select{ |my_file| /(mp3|MP3)$/ =~ my_file }
And added thsi code to my view:
<%= @mp3.select{ |file| /(mp3|MP3)$/ =~ file } %>
but nada. Any suggestions? Where do I put the folder. If it is in my
puiblic folder, am I referencing it right in my view? Thanks
-Shandy