Sha256: 3e4bc1c9c2cbcffeca4e5d52bdddd1c25e33a3c280774f441ca73dc6030a1c66

Contents?: true

Size: 896 Bytes

Versions: 2

Compression:

Stored size: 896 Bytes

Contents

module NeatPages::Helpers
  def neat_pages_ajax_items(partial_path, options={})
    ('<div id="neat-pages-ajax-wrapper" class="first-load">' + render(partial_path, options) + '</div>').html_safe
  end

  def neat_pages_base_url
    "#{request.protocol}#{request.host}#{request.port == 80 ? '' : ':' + request.port.to_s}#{request.path_info}"
  end

  def neat_pages_base_params
    request.env['action_dispatch.request.query_parameters']
  end

  def neat_pages_navigation(options={})
    NeatPages::Helpers::Navigation.new(pagination, neat_pages_base_url, neat_pages_base_params).generate(options)
  end

  def neat_pages_status
    NeatPages::Helpers::Status.new(pagination, neat_pages_base_url, neat_pages_base_params).generate
  end

  ::ActionView::Base.send :include, self
end

require 'neat_pages/helpers/builder'
require 'neat_pages/helpers/navigation'
require 'neat_pages/helpers/status'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
neat-pages-0.1.7 lib/neat_pages/helpers.rb
neat-pages-0.1.6 lib/neat_pages/helpers.rb