will_paginate不考虑WillPaginate :: ViewHelpers.pagination_options [:renderer]

时间:2011-10-20 10:13:44

标签: ruby-on-rails will-paginate

我已经完成了自定义LinkRenderer。使用时工作正常如下:

<%= will_paginate @results, :renderer => PaginationRenderer %>

但是将它放在初始化器中是行不通的:

WillPaginate::ViewHelpers.pagination_options[:renderer] = 'PaginationRenderer'

甚至

WillPaginate::ViewHelpers.pagination_options[:renderer] = PaginationRenderer

如果我在rails启动时打印WillPaginate::ViewHelpers.pagination_options[:renderer],它会回答正确的PaginationRenderer

似乎它在渲染时不使用它。我错过了什么吗?

1 个答案:

答案 0 :(得分:2)