Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

精华帖翻页点30页以后就没内容了 #210

Closed
kaku87 opened this issue Sep 2, 2013 · 3 comments
Closed

精华帖翻页点30页以后就没内容了 #210

kaku87 opened this issue Sep 2, 2013 · 3 comments

Comments

@kaku87
Copy link

kaku87 commented Sep 2, 2013

总页数的统计不对

@i3zhe
Copy link
Contributor

i3zhe commented Sep 10, 2013

  def excellent
    @topics = Topic.excellent.recent.fields_for_list.includes(:user).paginate(page: params[:page], per_page: 15, total_entries: 500)
    drop_breadcrumb(t("topics.topic_list.excellent"))
    set_seo_meta([t("topics.topic_list.excellent"),t("menu.topics")].join(" » "))
    render :action => "index"
  end

其实是从第9页就没有了,因为总数设置的是500

@realdah
Copy link

realdah commented Oct 2, 2013

对呀,为啥会有这么弱智的bug。。。。 哎

@zlx
Copy link
Contributor

zlx commented Jul 28, 2014

这个不一定是Bug,应该是考虑性能与功能之后的一个权衡决定。如果加上总页数,需要计算一遍总页数,不仅消耗了时间,并可能导致缓存失效,减低缓存命中率。不知道是不是这样 @huacnlee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants