Read files in directory on ruby on rails

Adnan Khan picture Adnan Khan · Jun 6, 2011 · Viewed 24.7k times · Source

I am new in ruby on rails and I want to read file names from a specified directory. Can anyone suggest code or any other links?

Thanks

Answer

Stobbej picture Stobbej · Jun 6, 2011

I suggest you use Dir.entries("target_dir")

Check the documentation here