I have the will_paginate plugin working in an application, but when I paginate a resource it just spits out the HTML as text, doesn't provide links to the next pages and such.
And when I manually type in the URL the plugin is working it just doesn't make <%= will_paginate @products %>
into links such as next 1 2 3 ... last
This is the output
<span class="disabled prev_page">&laquo; Previous</span> <span class="current">1</span> <a href="/products?page=2" rel="next">2</a> <a href="/products?page=2" class="next_page" rel="next">Next &raquo;</a>
controller: def index
@products = Product.all.paginate :per_page => 5, :page => params[:page]
@product_categories = ProductCategory.find(:all)
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @products }
end
end
view
<%= will_paginate @products %>
<%= will_paginate %> #for some reasons this works too