I am doing a typical database list, but when I do
<% for m in @private_messages %> (Line 28) It tells me that the method
‘each’ is undefined. What’s wrong, I did not call the method each…
Here’s the error:
Showing app/views/account/mail.rhtml where line #28 raised:
Ruby has a method where you could do… for example…
@private_messages.each do |m|
and that would do a for loop, with each object of @private_messages…
basically the same thing you’re trying to do with that for loop… I
assume
the for loop calls the .each method. Is @private_messages an array? or
a
Hash… if it isn’t, it won’t have the .each method.
a
Hash… if it isn’t, it won’t have the .each method.
It’s an array, or a database query @private_messages =
PrivateMessage.find_by_to_and_folder(authemail, folder)