Recently, I've been making web sites by using Merb.
It was like a battle lacking logistics.
I made and released dm-pagination on github.
Yes, I know dm-is-paginated-0.0.1, but its spec files was not working.
The dm-pagination is able to be used with arbitrary collections which include scoped_query.
You can easily paginate, like this:
ruby>>
class Posts
def index
@posts = Post.paginate(:page => params[:page])
end
<<--
Links will be drawn by calling simple helper method.
html>>
-
<% @posts.each do |post| %>
- <%= h(post.body) %> <% end %>
posted by
takiuchi on Thu 15 Jan 2009 at 02:33 with 0 comments