<% for @sites in @sites %>
<%= @sites.naam %>
<%= will_paginate @sites %>
<% end %>
that’s going to balls everything up: initially @sites is a
will_paginate collection, but then you’re overwriting it with a single
element from that collection. Also do you really want to be rendering
the pagination links for each elements. Typically you would do
someting like
for sites in @sites … (or use a partial, or @sites.each do |
site| …)
BTW, just in case, total_pages was recently added, it was called
page_count before.
Yes i’am using @sites for @sites
when i’am using something different i got the same issue
You’re not using it as in the examples. THe examples all go
for site in @sites #do something with site
end
will_paginate @sites
The way you do it can’t work because you are reassigning one of the
sites to @sites, but will_paginate wants you to pass a collection, not
an individual element.
Fred
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.