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

sitoto · October 14, 2012 · Last by sitoto replied at October 14, 2012 · 2378 hits

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

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

You need to Sign in before reply, if you don't have an account, please Sign up first.