remotty-rails 0.0.5 → 0.0.6

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
  SHA1:
3
- metadata.gz: 8055898b932109c2e2528d6ebfb46127f4e35f6e
4
- data.tar.gz: 92b9247d2d11c926a69c976329dfe3f3a5740235
3
+ metadata.gz: 460e7b9cd95d277288b4414a7f01eecd2c10a3da
4
+ data.tar.gz: 24207c3ddeaeca781f0188fee059e895c9c5ca2c
5
5
  SHA512:
6
- metadata.gz: 624f1cca5014dcf1dd55d7c11b5acb04f67503ffa120f2808851366dd83dd42304c4821e15cdce77b413346fa5a91bb77297dcf701ca9139c6177a622029beb9
7
- data.tar.gz: 667a741ad9221e32160f14e82757606e2aa10b00c456859a7b6ba5239a86b009bc41764e1b5e6b51393e3e2c75ead139739a5166369afdd66af945c479891286
6
+ metadata.gz: 2a98d0fe0dc11b9387ad2402fb66950eb7abdfa92c59d287d8b9a1f84426d88b384f3c3e68b75143288749589a29e79448572116c420fb19dfb571295bd25ccc
7
+ data.tar.gz: 8d020998211ef05fd5022d8e5ce12d951e9945d8e71a4c242906dcb77df87b4991c8866ea94cb9c7939e056ec4aa3608848ccc70798d1b25c049b5d356531844
@@ -20,17 +20,20 @@ module Remotty::BaseApplicationController
20
20
  protected
21
21
 
22
22
  # paging - kaminari dependency
23
- def render_paging(items)
24
- meta = {
25
- total_count: items.total_count,
26
- current_page: items.current_page,
27
- per_page: items.limit_value
23
+ def render_paging(items, options = nil)
24
+ page = {
25
+ json: items,
26
+ meta_key: 'page',
27
+ meta: {
28
+ total_count: items.total_count,
29
+ current_page: items.current_page,
30
+ per_page: items.limit_value
31
+ },
32
+ root: 'items'
28
33
  }
34
+ page.merge!(options) unless options.nil?
29
35
 
30
- render json: items,
31
- meta_key: 'page',
32
- meta: meta,
33
- root: 'items'
36
+ render page
34
37
  end
35
38
 
36
39
  # error
@@ -1,5 +1,5 @@
1
1
  module Remotty
2
2
  module Rails
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remotty-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chungsub Kim