<?xml version="1.0" encoding="UTF-8"?>
<article>
  <body>I made a new pagination library for the NamedScope era.
You can use will_paginate for ordinary case.
It must be better than the young PaginationScope library.
But if you want to paginate with complicated chained named_scopes, this is suitable.

**Usage**

At first, include the module into your model class.

rails&gt;&gt;
class Post
  include PaginationScope
&lt;&lt;--

By this, the scope named &quot;paginate&quot; is made.

And then, in the controller of which you want to use pagination,
you can get the scope for pagination like this.

rails&gt;&gt;
class PostsController &lt; ApplicationController
  def index
    @posts = Post.not_deleted.paginate(params[:page], 10)
&lt;&lt;--

Finally, the pagination links are generated by calling the view helper, like this.

html&gt;&gt;
&lt;%= paginate @posts %&gt;
&lt;&lt;--

Have fun!

</body>
  <cached-tag-list>rails gem</cached-tag-list>
  <comments-count type="integer">0</comments-count>
  <created-at type="datetime">2008-08-16T23:58:23+00:00</created-at>
  <daily-archive-id type="integer">716</daily-archive-id>
  <filter-type>blue_stole</filter-type>
  <id type="integer">788</id>
  <monthly-archive-id type="integer">93</monthly-archive-id>
  <pdf-digest nil="true"></pdf-digest>
  <permalink>/articles/788</permalink>
  <published-at type="datetime">2008-08-16T23:57:00+00:00</published-at>
  <secret>ce9d6af3-e0d3-4af9-b2cc-3890cd002312</secret>
  <title>PaginationScope: The Pagination Library of the NamedScope Era</title>
  <updated-at type="datetime">2008-08-16T23:58:24+00:00</updated-at>
  <user-id type="integer">9</user-id>
</article>
