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

如果没有帖子的情况下打开 localhost:10000/topics 会 500服务器内部错误 #37

Closed
sekirocc opened this issue May 13, 2013 · 2 comments

Comments

@sekirocc
Copy link

如果没有帖子的情况下打开 localhost:10000/topics 会 500服务器内部错误。

undefined method `current_page' for []:

因为在cached_pagination 方法中返回了 [].

return Rabel::Model::EMPTY_DATASET unless ts.present?

改为

return Kaminari.paginate_array(Rabel::Model::EMPTY_DATASET).page(0) unless ts.present?

则不报错。

@daqing
Copy link
Owner

daqing commented Jun 7, 2013

多谢反馈。

daqing pushed a commit that referenced this issue Jun 14, 2013
@daqing
Copy link
Owner

daqing commented Jun 14, 2013

已经修正。

@daqing daqing closed this as completed Jun 14, 2013
daqing pushed a commit that referenced this issue Jan 19, 2023
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

2 participants