3
我有一個表和分頁到20個每頁:will_paginate增量表ID
<% @num = 0%>
<table>
<tr>
<th>id</th>
<th>title</th>
</tr>
<% for authors in @authors%>
<tr>
<td><%= @num += 1 %></td>
<td><%= authors.title %></td>
</tr>
<% end %>
</table>
<%= will_paginate @authors%>
我想提出的ID行要繼續。當我點擊第1頁時,我應該看到1,2 3,4等id。當我點擊第二頁我應該看到21,22,23等,但它只是重新啓動,以1,2 3
謝謝,我會嘗試。我正在使用rails 2.3 – fujisan
它完美無瑕。 – fujisan
此代碼如何工作?你能否詳細說明一下? – fujisan