Controller
def index
@sites = Site.paginate :per_page => 10, :page => params[:page]
end
View
<% for @sites in @sites %>
<%= @sites.naam %>
<%= will_paginate @sites %>
<% end %>
Also i set require 'will_paginate' below into the envoirment.rb
Is there a way to get will_paginate working well or is there a better
solution.
--
Posted via http://www.ruby-forum.com/.
I'm guessing that you left off ':all' in your code.
try this:
@sites = Site.paginate( :all, :per_page => 10, :page => params[:page] )
Good luck!
Cheers,
Robby
--
Robby Russell
Chief Evangelist, Partner
PLANET ARGON, LLC
design // development // hosting
http://www.planetargon.com/
http://www.robbyonrails.com/
aim: planetargon
+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]
http://railscasts.com/episodes/51
and the official manual
http://rock.errtheblog.com/will_paginate
even the require 'will_paginate' i did
Only without any result
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
How can i fix total_pages the error contains into the gem