新手问题 请教下 Kaminari 不刷新怎么自动分页

tt12580-github · March 06, 2017 · Last by tt12580-github replied at March 06, 2017 · 1295 hits

在做一个上传图片的 demo,遇到了一个问题。上传后页面会自动刷新,新添加的图片也出现在最前面了,但就是分页出现了问题 分页要刷新下才能正常显示布局,请各位大佬们帮忙解决下。 demo:https://tt12580-demo.herokuapp.com/addresses 代码:https://github.com/tt12580/mini_test

外框增加 CSS clearfix

代码参考:

.clearfix:after {
  visibility: hidden;
  display: block;
  font-size: 0;
  content: " ";
  clear: both;
  height: 0;
}
.clearfix { display: inline-block; }
/* start commented backslash hack \*/
* html .clearfix { height: 1%; }
.clearfix { display: block; }
/* close commented backslash hack */

@huacnlee 谢谢帮忙,但好像还是有点问题,我是希望能够在添加图片后还是保持一页 8 个,多出来的能直接搞到第二页去

好像是可以不刷新的,在 view 加上:

<%= paginate @users, remote: true %>

参考官方文档

Reply to xofred2

我加了那句了的

tt12580-github closed this topic. 07 Mar 17:54
You need to Sign in before reply, if you don't have an account, please Sign up first.