ruby - rails 分页: will paginate, 对于大数据量,不要用@count ,会引起加载缓慢,要使用without
访问量: 99
前端erb 页面:
<%= link_to_prev_page @trades, "上一页" %>
<%= link_to_next_page @trades, "下一页" %>
后端controller:
@trades.page(params[:page]).per(1000).without_count
访问量: 99
前端erb 页面:
<%= link_to_prev_page @trades, "上一页" %>
<%= link_to_next_page @trades, "下一页" %>
后端controller:
@trades.page(params[:page]).per(1000).without_count