What's wrong with my index.rhtml?

(lists) #1

     When I use some eruby examples from the PickAxe book as my index.rhtml file, the page loads. When my index.rhtml file contains the following, I get a server error 500:

<% Dir.glob("*") do |i| %>
   <% if test(?d, i) %>
       <td><%= i %></td>
         <td align="right"><a href="<%= i %>/index.html"><%= i %></


   <% end %>
<% end %>

I think the problem lies with test(). I noticed the same thing happens with File.stat() and File.directory?(). Any ideas as to what's failing or suggestions?