selva_raj
(selva raj)
January 17, 2011, 5:41am
1
i got an error ,
undefined method `each'
and i am using the following code
<% for book in @books do %>
<%= will_paginate @books %>
<tr>
<td><%=h book.publisher.name %></td>
<td><%=h book.title %></td>
<td><%=h book.isbn %></td>
please help me
Thanks.
Hard to say but probably means that @books isn't an enumerable
collection (such as an array)
Fred
I also suspect that you want that <%= will_paginate @books %> line
before the for loop.
Raj
(Raj)
January 17, 2011, 12:02pm
4
<% for book in @books %>
<%=h [book.publisher.name](http://book.publisher.name/) %>
<%=h book.title %>
<%=h book.isbn %>
<%end%>
<%= will_paginate @books %>
selva_raj
(selva raj)
January 17, 2011, 12:18pm
5
Thanks to all , i found the answer that
<% @books.each do |book| %>
<tr>
<td><%=h book.publisher.name %></td>
<td><%=h book.title %></td>
<td><%=h book.isbn %></td>
its working.......