Hi guys

i got an error ,
undefined method `each’
and i am using the following code

<% for book in @books do %>
<%= will_paginate @books %>

<%=h book.publisher.name %> <%=h book.title %> <%=h book.isbn %>

please help me
Thanks.

On Jan 17, 5:41am, selva raj [email protected] wrote:

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.

<% for book in @books %>

<%=h book.publisher.name %> <%=h book.title %> <%=h book.isbn %> <%end%>

<%= will_paginate @books %>

On Mon, Jan 17, 2011 at 5:28 PM, Peter H. <

Thanks to all , i found the answer that
<% @books.each do |book| %>

<%=h book.publisher.name %> <%=h book.title %> <%=h book.isbn %>

its working…