Sha256: a3154af10b8e7b858cc39afc34f08be598b386e0cf8b4d80493453ec69bd06d2

Contents?: true

Size: 791 Bytes

Versions: 3

Compression:

Stored size: 791 Bytes

Contents

require 'will_paginate/view_helpers/link_renderer' 
require 'will_paginate/view_helpers/action_view'


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

  def html_container(html)
    html = "<span class=\"name\">#{@options[:name]}</span>#{html}" if @options[:name]
    tag(:div, html, container_attributes)
  end

  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)

    @template.commontator.url_for(url_params)
  end

  private

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
commontator-7.0.1 app/helpers/commontator/link_renderer.rb
commontator-7.0.0 app/helpers/commontator/link_renderer.rb
commontator-6.3.2 app/helpers/commontator/link_renderer.rb