Rails 使用 will_paginate 分页问题

a8885313 · January 16, 2013 · 1746 hits

class BlogYear < ActiveRecord::Base default_scope :order => "name Desc" attr_accessible :name ,:blogs has_many :blogs end

使用 will_paginate 给 BlogYear 中 blogs 分页,

class Blog < ActiveRecord::Base belongs_to :blog_year attr_accessible :content , :title... end

并不能直接给 Blog 分页因为要根据 BlogYear 分组

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