Today, maiha, the author of the one of the most authorized books regarding rails in Japan, had sent me a patch including various improvements for the PaginationScope.
I want to say thank you for the great contribution.

And then I merged it into the master and pushed to the GitHub.

http://github.com/genki/pagination_scope/tree/master

Here is the list of improvements from Maiha.

<モデル>

  • AR.paginate の第三引数に options を渡せるように変更
  • AR.paginate の options は第一引数でも可能にした
    AR.paginate(params[:page], 10, options)
    以外にも以下のように書ける
    ruby>>
    options = {
    :page => params[:page],
    :per_page => 10,
    :order => "id",
    }
    AR.paginate(options)
    <<--

<ヘルパ>

  • Helper#paginate のオプション名を変更 (newer->prev, older->next)
    昇順、降順によって newer/older が逆の意味になってわかり辛かったので
  • Helper#paginate の各要素にクラス名を付与
    will_paginate のスタイルシートがそのまま使えるように合わせた
  • Helper#paginate のリンクに rel 属性を追加
    AutoPagerize 対応
  • Helper#paginate のオプションに truncate を追加
    省略時の '...' を設定可能にした

Thanks again!

posted by takiuchi takiuchi on Fri 26 Sep 2008 at 18:46 with 0 comments