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. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jan 17, 5:41 am, selva raj <ksraj....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I also suspect that you want that <%= will_paginate @books %> line before the for loop. On 17 January 2011 11:55, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Jan 17, 5:41 am, selva raj <ksraj....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> 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 > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
<% for book in @books %> <tr> <td><%=h book.publisher.name %></td> <td><%=h book.title %></td> <td><%=h book.isbn %></td> <%end%> <%= will_paginate @books %> On Mon, Jan 17, 2011 at 5:28 PM, Peter Hickman < peterhickman386-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> I also suspect that you want that <%= will_paginate @books %> line > before the for loop. > > On 17 January 2011 11:55, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > > > On Jan 17, 5:41 am, selva raj <ksraj....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> 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 > > > > -- > > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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....... On Jan 17, 5:02 pm, Ratnam Raj varasala <chinnuj...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> <% for book in @books %> > > <tr> > <td><%=h book.publisher.name %></td> > <td><%=h book.title %></td> > <td><%=h book.isbn %></td> > <%end%> > > <%= will_paginate @books %> > > On Mon, Jan 17, 2011 at 5:28 PM, Peter Hickman < > > peterhickman...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > I also suspect that you want that <%= will_paginate @books %> line > > before the for loop. > > > On 17 January 2011 11:55, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > > On Jan 17, 5:41 am, selva raj <ksraj....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >> 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 > > > > -- > > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm. > > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > . > > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.