Sha256: 97875c6285ca25310b36d06e634046212512fa593d99ecffb6b88d99abb8169e

Contents?: true

Size: 688 Bytes

Versions: 9

Compression:

Stored size: 688 Bytes

Contents

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

9 entries across 9 versions & 1 rubygems

Version Path
commontator-6.3.1 app/helpers/commontator/link_renderer.rb
commontator-6.3.0 app/helpers/commontator/link_renderer.rb
commontator-6.2.1 app/helpers/commontator/link_renderer.rb
commontator-6.2.0 app/helpers/commontator/link_renderer.rb
commontator-6.1.1 app/helpers/commontator/link_renderer.rb
commontator-6.1.0 app/helpers/commontator/link_renderer.rb
commontator-6.0.1 app/helpers/commontator/link_renderer.rb
commontator-6.0.0 app/helpers/commontator/link_renderer.rb
commontator-6.0.0.pre.2 app/helpers/commontator/link_renderer.rb