分页的变量@number_of_shop_records_to_display
不起作用!
但如果我只用1
替换它,它就可以了
为什么呢?
before_filter :set_variable
def set_variable
@number_of_shop_records_to_display = 10
@number_of_shop_tags_to_display = 20
end
def index
....
@search = Shop.search do
fulltext params[:search]
paginate :page => params[:page], :per_page => @number_of_shop_records_to_display
end
@shops = @search.results
....
end