アプリケーションで will_paginate プラグインを使用していますが、リソースをページ分割すると、HTML がテキストとして吐き出され、次のページなどへのリンクが提供されません。
<%= will_paginate @products %>
そして、プラグインが機能している URL を手動で入力すると、次の 1 2 3 ... 最後などのリンクにはなりません。
これが出力です
<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>
コントローラー: 定義インデックス
@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
終わり
見る
<%= will_paginate @products %>
<%= will_paginate %> #for some reasons this works too