1

I have a pagination like:

« First ‹ Prev 1 2 ... 13 14 15 16 17 18 19 20 21 ... 24 25 Next › Last »

This is too long. How can I make this shorter, e.g.:

« ‹ 15 16 17 18 19 › »

jjjfff
  • 99
  • 6

1 Answers1

0

wice_grid uses Kaminari internally so you should just be able to configure it in an initializer:

Kaminari.configure do |config|
  window               2 # 4 by default
end

and then you would need to override these I18n values in your locale:

en:
  views:
    pagination:
      first: "« First"
      last: "Last »"
      previous: "‹ Prev"
      next: "Next ›"
      truncate: "…"

https://github.com/amatsuda/kaminari

patrick
  • 9,290
  • 13
  • 61
  • 112
  • I tried to Kaminari.configure do |config| config.window = 2 end but the result is the same. – jjjfff Sep 03 '15 at 18:39
  • Ah... I just found this --> https://github.com/leikind/wice_grid/blob/8db9abc6ab26a2e906b34939469ed04fa4fd17c5/lib/wice/helpers/wice_grid_view_helpers.rb#L625 – patrick Sep 03 '15 at 19:01
  • looks like your only choice is to overwrite that method or define your own paginate method that will override those parameters and call down to Kaminari directly. – patrick Sep 03 '15 at 19:04