Ruby on rails 分页功能是否不呈现页面链接
我试图实现的是对大量行(约8000行)进行分页。所以我用Ruby on rails 分页功能是否不呈现页面链接,ruby-on-rails,ruby,will-paginate,Ruby On Rails,Ruby,Will Paginate,我试图实现的是对大量行(约8000行)进行分页。所以我用 @extractedpacks = ExtractedPack.all.paginate :page => params[:page], :per_page=>20, :order => 'id DESC' 在控制器中分页 在视图index.html.erb中 <% @extractedpacks.each do |news| %> <tr> <td><%= news.na
@extractedpacks = ExtractedPack.all.paginate :page => params[:page],
:per_page=>20, :order => 'id DESC'
在控制器中分页
在视图index.html.erb中
<% @extractedpacks.each do |news| %>
<tr>
<td><%= news.name %></td>
<td><%= news.acted_upon %></td>
<td><%= news.crawl_category %></td>
<td><%= link_to action_generator(news.crawl_category, news), @actionurl %></td>
</tr>
<% end %>
</tbody>
</table>
<%= will_paginate @extractedpacks %>
我已经输入config/application.rb(在浏览stackoverflow之后)
请帮忙。。如果你需要任何其他信息,请告诉我
请注意强>
extractedpacks肯定在工作
如果我没有在视图中使用
,我将得到前20行。。
如果我尝试手动增加页码,如
localurl?page=2
那就行了
确切的问题是will_paginate没有呈现页面。稍微更改@extractedpacks=ExtractedPack.paginate(:page=>params[:page],:per_page=>30)。order('id DESC')@Debadatt:似乎也不是这样工作的-(@Debadatt:pagination确实发生了…但问题在于链接呈现程序..意味着正常情况下,单击页面链接后不会发生任何事情?请在GemFile中尝试此操作….gem'will_paginate',:git=>,:branch=>“rails3”
require 'will_paginate'
localurl?page=2