Class: Kaminari::Helpers::PrevPage
- Includes:
- Link
- Defined in:
- lib/kaminari/helpers/tags.rb
Overview
The “previous” page of the current page
Instance Method Summary collapse
-
#initialize(template, params: {}, param_name: nil, theme: nil, views_prefix: nil, **options) ⇒ PrevPage
constructor
TODO: Remove this initializer before 1.3.0.
-
#page ⇒ Object
:nodoc:.
Methods included from Link
Methods inherited from Tag
Constructor Details
#initialize(template, params: {}, param_name: nil, theme: nil, views_prefix: nil, **options) ⇒ PrevPage
TODO: Remove this initializer before 1.3.0.
123 124 125 126 127 128 129 130 131 132 |
# File 'lib/kaminari/helpers/tags.rb', line 123 def initialize(template, params: {}, param_name: nil, theme: nil, views_prefix: nil, **) #: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, **) end |
Instance Method Details
#page ⇒ Object
:nodoc:
134 135 136 |
# File 'lib/kaminari/helpers/tags.rb', line 134 def page #:nodoc: @options[:current_page] - 1 end |