Class: WillPaginate::ActionView::LinkRenderer

Inherits:
ViewHelpers::LinkRenderer
  • Object
show all
Defined in:
core/config/initializers/will_paginate_monkeypatch.rb

Instance Method Summary collapse

Instance Method Details

#url(page) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'core/config/initializers/will_paginate_monkeypatch.rb', line 6

def url(page)
  @base_url_params ||= begin
    url_params = merge_get_params(default_url_params)
    merge_optional_params(url_params)
  end

  url_params = @base_url_params.dup
  add_current_page_param(url_params, page)

  if /refinery/ === url_params[:controller]
    @template.refinery.url_for(url_params)
  else
    @template.url_for(url_params)
  end
end