在Rails 4应用中,我使用了will_paginate
和will_paginate-bootstrap
宝石:
=will_paginate @things, renderer: BootstrapPagination::Rails
是否可以在分页中指定逗号分隔符,因此较高的页面将列为30,115和30,116?
我了解number_with_delimiter但我不知道如何在will_paginate
中使用此功能。
答案 0 :(得分:0)
您可以尝试以下代码(将其放入ApplicationHelper)
def page_entries_info(collection, options = {})
raw super(collection, options).gsub(/\<b\>\d*\<\/b\> in total/, "<b>#{number_with_delimiter(collection.total_entries)}</b> in total")
end