kaminari_indexing 0.0.0 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d77adcf961e4da762d7f033a906b3b66f5a594419179b7cfa1251c14032516b0
4
- data.tar.gz: b63a88ef9a842b6c2cd94559e0ba1c13268414f04ed490e1c782f354c4abfa12
3
+ metadata.gz: 6440586d6533a2dd03b5e51245d3970f111bf768fe13aa14f8e1618093f43ad9
4
+ data.tar.gz: 63f7c944169f7427b160b7b7a867cb5737ea674f4cdfb9189a21f401ce0215ba
5
5
  SHA512:
6
- metadata.gz: 13803d63ebe9012c59e5bacbd828d26bbc847cb3a354afb0e22086f021d4512385e96d262cda296aa938e98ae18c7cfe882d3cd625dd1b65f368d32917471254
7
- data.tar.gz: 68d77b00c13afee5e5676cd34679416aa1ad2d3d88b41e257abecbd2e106c4f6e407d0e5c04fcabc86929628c60719106f826f947e012377de782082cad76271
6
+ metadata.gz: 561cdb2bace64d384504afeaed74f2414c6c7e9e4c4f9c98e2c05d3c36319ad5463e0179bb2ca45cd3b237aea6b4e8184adca5e62c6ea0bdce64ae309fc48711
7
+ data.tar.gz: dd2c77713e3107dcf82e93a9e4fed492c54e5eb005d51c19df7992073353ea3ef171c4f966d069a7c6e653f6b459709631c757b29a885a18cf34be5be292a8ac
@@ -1,7 +1,9 @@
1
1
  module KaminariIndexing
2
2
  module Helper
3
- def hello
4
- 'Hello this is kaminari indexing'
3
+ def kaminari_index(index, per_page)
4
+ page = (params[:page] || 1).to_i
5
+ page_offset = (page - 1) * per_page
6
+ index + page_offset + 1
5
7
  end
6
8
  end
7
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaminari_indexing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - habiburrahman
@@ -9,7 +9,21 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2020-12-24 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: kaminari
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.2'
13
27
  description: A simple indexing helper for kaminari pagination
14
28
  email: habib.maison@gmail.com
15
29
  executables: []