Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add Pages numbers inverse #340

Closed
zephiro opened this Issue Sep 25, 2013 · 1 comment

Comments

Projects
None yet
2 participants

zephiro commented Sep 25, 2013

Hey can implementation inverse order of pages numbers ex.

normal order << 1, 2, 3, 4, 5, ... 10 >>

inverse order << 10, 9, 8, 7, 6, ... 1 >>

https://github.com/mislav/will_paginate/blob/master/lib/will_paginate/view_helpers/link_renderer.rb

Line 25 - 33

def to_html
    html = pagination.map do |item|
      item.is_a?(Fixnum) ?
        page_number(item) :
        send(item)
    end.join(@options[:link_separator])

    @options[:container] ? html_container(html) : html
  end

pagination.reverse.map, implementing a method for this.

Owner

mislav commented Sep 27, 2013

This can be achieved by creating a custom link renderer. I won't include such feature in core.

@mislav mislav closed this Sep 27, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment