In the book, “Agile Web Development With Rails” there is a simple idea for an example program using the command:
@dirs = Dir.glob(’*’)
Then they suggest writing the code to display the directory contents but don’t say how. So I wrote a file called app/views/say/dirlist.rb which has the following code:Directory Listing
<%= @dirs %>
The problem is that while all the file and directory names are displayed, they are also all “run together”. What would be the easiest and most logical way to format the output so that the filenames are separated by ", "?