class WillPaginate::ActionView::LinkRenderer
Protected Instance Methods
add_current_page_param(url_params, page)
click to toggle source
# File lib/will_paginate/view_helpers/action_view.rb, line 131 def add_current_page_param(url_params, page) unless param_name.index(/[^\w-]/) url_params[param_name.to_sym] = page else page_param = parse_query_parameters("#{param_name}=#{page}") symbolized_update(url_params, page_param) end end
default_url_params()
click to toggle source
# File lib/will_paginate/view_helpers/action_view.rb, line 102 def default_url_params {} end
merge_get_params(url_params)
click to toggle source
# File lib/will_paginate/view_helpers/action_view.rb, line 119 def merge_get_params(url_params) if @template.respond_to? :request and @template.request and @template.request.get? symbolized_update(url_params, @template.params) end url_params end
merge_optional_params(url_params)
click to toggle source
# File lib/will_paginate/view_helpers/action_view.rb, line 126 def merge_optional_params(url_params) symbolized_update(url_params, @options[:params]) if @options[:params] url_params end
url(page)
click to toggle source
# File lib/will_paginate/view_helpers/action_view.rb, line 106 def url(page) @base_url_params ||= begin url_params = merge_get_params(default_url_params) url_params[:only_path] = true merge_optional_params(url_params) end url_params = @base_url_params.dup add_current_page_param(url_params, page) @template.url_for(url_params) end
Private Instance Methods
parse_query_parameters(params)
click to toggle source
# File lib/will_paginate/view_helpers/action_view.rb, line 142 def parse_query_parameters(params) Rack::Utils.parse_nested_query(params) end