Sha256: e8af7acb697ad95d4bc6b4f7ee945dbe4acdf3748633d9614196b0cacbdb5169

Contents?: true

Size: 679 Bytes

Versions: 11

Compression:

Stored size: 679 Bytes

Contents

require 'will_paginate/view_helpers/action_view'

module Commontator
  class LinkRenderer < WillPaginate::ActionView::LinkRenderer
    protected

    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)

      routes_proxy = @options[:routes_proxy] || @template
      routes_proxy.url_for(url_params)
    end

    private

    def link(text, target, attributes = {})
      attributes = attributes.merge('data-remote' => true) \
        if @options[:remote]
      super
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
commontator-5.1.0 lib/commontator/link_renderer.rb
commontator-5.0.0 lib/commontator/link_renderer.rb
commontator-4.11.1 lib/commontator/link_renderer.rb
commontator-4.11.0 lib/commontator/link_renderer.rb
commontator-4.10.5 lib/commontator/link_renderer.rb
commontator-4.10.4 lib/commontator/link_renderer.rb
commontator-4.10.3 lib/commontator/link_renderer.rb
commontator-4.10.2 lib/commontator/link_renderer.rb
commontator-4.10.1 lib/commontator/link_renderer.rb
commontator-4.10.0 lib/commontator/link_renderer.rb
commontator-4.9.0 lib/commontator/link_renderer.rb