2012-07-23 73 views
-1

我要顯示我的PAGINATE的記錄,像下面的格式20下一個環節的威爾Paignate:上一頁20下一個鏈接的鏈接> 1>

上一頁鏈接> 1>

,其中1代表第1頁和20代表總頁數。 如果我點擊下一個然後我喜歡顯示下面的格式。 上一個鏈接> 2 of 20下一個鏈接>

我沒有找到如何使用will_paginate在rails 3中得到這個。

感謝您的任何幫助。

回答

1

嘗試以下

<%= will_paginate @item, :page_links => false, 
       :separator =>" #{@item.current_page} of #{@item.page_count} "%> 

O /的這個P是像下面

類似以下

« Previous 1 of 17 Next » 

對於下面的O/P

Previous link> 1 of 20 next link> 

你必須做一些事情

<%= will_paginate @item, :page_links => false, 
       :separator =>" #{@item.current_page} of #{@item.page_count} ", 
       :prev_label => "Previous link>", :next_label => "Next link>" %> 
0

你可以做這樣的事情:

<%= will_paginate @item, :previous_label => "Previous link", :next_label => "Next Link" %> 

乾杯!

相關問題