Sha256: 352e301db0fad99cdaa5fb35a4800cfda0892396f8e3528429dc23d9d713be00

Contents?: true

Size: 524 Bytes

Versions: 2

Compression:

Stored size: 524 Bytes

Contents

# A custom WillPaginate LinkRenderer Class for rendering remote links.
require 'will_paginate/view_helpers/action_view'

module Alchemy
  class RemotePaginationLinkRenderer < WillPaginate::ActionView::LinkRenderer

    def prepare(collection, options, template)
      @remote = options.delete(:remote) || {}
      super(collection, options, template)
    end

  private

    def link(text, target, attributes = {})
      attributes["data-remote"] = "true" if @remote
      super(text, target, attributes)
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alchemy_cms-2.0.rc2 lib/alchemy/remote_pagination_link_renderer.rb
alchemy_cms-2.0.rc1 lib/alchemy/remote_pagination_link_renderer.rb