small medium large xlarge

18 Jul 2009, 02:52
Anthony Newland (1 post)

I’m having a real hard time understanding the last practice problem in chapter 4. Every time I try to correctly place the coding into the .rhtml document, I get the following error:

NoMethodError in Say#files

Showing app/views/say/files.rhtml where line #1 raised:

You have a nil object when you didn’t expect it! You might have expected an instance of Array. The error occurred while evaluating nil.each

Extracted source (around line #1):

1: <% for file in @files %> 2: file name is: <%= file %> 3: <% end %> 4:

I don’t know what’s happening. I’ve defined @files as the following: @files = Dir.glob(‘*’)

Any suggestions?

You must be logged in to comment