Class: Kaminari::Helpers::NextPage

Inherits:
Tag
  • Object
show all
Includes:
Link
Defined in:
lib/kaminari/helpers/tags.rb

Overview

The “next” page of the current page

Instance Method Summary collapse

Methods included from Link

#to_s, #url

Methods inherited from Tag

#page_url_for, #to_s

Constructor Details

#initialize(template, params: {}, param_name: nil, theme: nil, views_prefix: nil, **options) ⇒ NextPage

TODO: Remove this initializer before 1.3.0.



144
145
146
147
148
149
150
151
152
153
# File 'lib/kaminari/helpers/tags.rb', line 144

def initialize(template, params: {}, param_name: nil, theme: nil, views_prefix: nil, **options) #:nodoc:
  # params in Rails 5 may not be a Hash either,
  # so it must be converted to a Hash to be merged into @params
  if params && params.respond_to?(:to_unsafe_h)
    ActiveSupport::Deprecation.warn 'Explicitly passing params to helpers could be omitted.'
    params = params.to_unsafe_h
  end

  super(template, params: params, param_name: param_name, theme: theme, views_prefix: views_prefix, **options)
end

Instance Method Details

#pageObject

:nodoc:



155
156
157
# File 'lib/kaminari/helpers/tags.rb', line 155

def page #:nodoc:
  @options[:current_page] + 1
end