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 分组