Rails topic embed posts 的情况下,如何分页显示 posts 呢?

sitoto · 2012年10月14日 · 最后由 sitoto 回复于 2012年10月14日 · 2377 次阅读

topic embed posts 的情况下,如何分页显示 posts 呢?👀

class Topic
     include Mongoid::Document
     field :title
     field :body
     embed_many :posts
end
class Post
    include Mongoid::Document
    field :content
    embeded_in :topic
end

这种结构下,,因为 posts 比较多,是否可以做分页显示?

应该是:查询 topic 以及里面 的 部分 posts

anybody?

没看懂,你问的问题

#2 楼 @lidashuang

谢谢回复,修改了下,这下清晰点了。

需要 登录 后方可回复, 如果你还没有账号请 注册新账号