Module: Warped::Controllers::Pageable::Ui

Extended by:
ActiveSupport::Concern
Includes:
Warped::Controllers::Pageable
Included in:
Tabulatable::Ui
Defined in:
lib/warped/controllers/pageable/ui.rb

Instance Method Summary collapse

Methods included from Warped::Controllers::Pageable

#page, #per_page

Instance Method Details

#paginateObject



32
33
34
35
36
# File 'lib/warped/controllers/pageable/ui.rb', line 32

def paginate(...)
  @paginated = true

  super
end

#paginate_url_params(**options) ⇒ Hash

Returns The paginate_url_params.

Returns:

  • (Hash)

    The paginate_url_params



18
19
20
21
# File 'lib/warped/controllers/pageable/ui.rb', line 18

def paginate_url_params(**options)
  url_params = { page:, per_page: }
  url_params.merge!(options)
end

#paginated?Boolean

Returns Whether the current action is paginated.

Returns:

  • (Boolean)

    Whether the current action is paginated.



39
40
41
# File 'lib/warped/controllers/pageable/ui.rb', line 39

def paginated?
  @paginated ||= false
end

#paginationHash

Returns:

  • (Hash)

See Also:



25
26
27
28
29
# File 'lib/warped/controllers/pageable/ui.rb', line 25

def pagination
  super.tap do |hsh|
    hsh[:series] = series(hsh[:page], hsh[:total_pages])
  end
end