activeadmin_active_resource 0.1.0 → 0.1.1

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: 584701cd42eaef807c228819c00353358776a9cb
4
- data.tar.gz: 5097463f09f5324a91cca9cb82f044c558126ca5
3
+ metadata.gz: 693924c691a6662812b9272be525e0749137b642
4
+ data.tar.gz: 7351de5cb82fc67a7acb6cf0ab42f3e81c7e4798
5
5
  SHA512:
6
- metadata.gz: 9b23e1c46e61285cb669612137df26c33137eeff216fdf8650fe1eda100f145a9cad5c062b2120a483b60784efb29580911d1c604e4f1099183aed6a3a80a860
7
- data.tar.gz: 1c0e5e687dc4ff6de579d4d6b7e7aadb7ee2bcbc1998215368425e798a235f38ea768b2b655103f3988d50a8dae2f54aead18028831071a5316c97284be77c24
6
+ metadata.gz: b14cee7688627c7865e484161a3b1ccf86ef9c3b8d0f3f6873690647c7454f7c3af2f622a36e7d772b84bc159deee89d80cb6eaaeac6bb624776281790c4eb71
7
+ data.tar.gz: eccbba12431224eb4d96c9f36c5de219bdc2b54ade4f505ab951035a5199e6048475307916f27fe19808c36445bcfd290fd75fd84d257253eabb866ede8176bb
data/README.md CHANGED
@@ -6,15 +6,17 @@ Data is fetched from an external API.
6
6
 
7
7
  WARNING: this component is a Beta version, some Active Admin functionalities don't work as expected:
8
8
 
9
- - Batch Action: not currently supported
9
+ - Batch Action: not supported
10
10
  - Filters: partially supported (see example)
11
11
  - Edit: fields must be configured explicitly
12
+ - Comments: not supported
12
13
 
13
14
  ## Install
14
15
 
15
16
  - Add to your Gemfile:
16
17
  `gem 'activeadmin_active_resource'`
17
18
  - Execute bundle
19
+ - Disable comments in active_admin config initializer
18
20
 
19
21
  ## Example
20
22
 
@@ -43,26 +45,31 @@ end
43
45
 
44
46
  ```rb
45
47
  ActiveAdmin.register Post do
46
- # config.filters = false
48
+ config.batch_actions = false
47
49
 
48
- filter :title_cont
50
+ filter :title_cont # Ransack postfixes required (_eq, _cont, etc.)
49
51
 
50
52
  controller do
51
53
  def permitted_params
52
- params.permit!
54
+ params.permit! # Just to make things easier :)
53
55
  end
54
56
  end
55
57
 
56
58
  form do |f|
57
59
  f.inputs do
58
- f.input :id, as: :hidden unless f.object.new_record?
60
+ f.input :id, as: :hidden unless f.object.new_record? # Required
59
61
  f.input :title
62
+ # ... other fields
60
63
  end
61
64
  f.actions
62
65
  end
63
66
  end
64
67
  ```
65
68
 
69
+ ## Notes
70
+
71
+ If you create a new rails project don't use *--skip-active-record*
72
+
66
73
  ## Do you like it? Star it!
67
74
 
68
75
  If you use this component just star it. A developer is more motivated to improve a project when there is some interest.
@@ -1,7 +1,11 @@
1
1
  require 'active_admin'
2
2
 
3
- class ActiveAdmin::ActiveResource::Engine < ::Rails::Engine
4
- engine_name 'activeadmin_active_resource'
3
+ module ActiveAdmin
4
+ module ActiveResource
5
+ class Engine < ::Rails::Engine
6
+ engine_name 'activeadmin_active_resource'
7
+ end
8
+ end
5
9
  end
6
10
 
7
11
  ::ActiveResource::Base.class_eval do
@@ -1,19 +1,23 @@
1
- class ActiveAdmin::ActiveResource::Results < ActiveResource::Collection
2
- attr_accessor :current_page, :limit_value, :total_count, :total_pages
1
+ module ActiveAdmin
2
+ module ActiveResource
3
+ class Results < ::ActiveResource::Collection
4
+ attr_accessor :current_page, :limit_value, :total_count, :total_pages
3
5
 
4
- def initialize( elements = [] )
5
- super elements
6
- @limit_value = ActiveAdmin.application.default_per_page
7
- @total_count = 0
8
- @total_pages = 1
9
- @current_page = 1
10
- end
6
+ def initialize( elements = [] )
7
+ super elements
8
+ @limit_value = ActiveAdmin.application.default_per_page
9
+ @total_count = 0
10
+ @total_pages = 1
11
+ @current_page = 1
12
+ end
11
13
 
12
- def except( *params )
13
- self
14
- end
14
+ def except( *params )
15
+ self
16
+ end
15
17
 
16
- def group_values
17
- nil
18
+ def group_values
19
+ nil
20
+ end
21
+ end
18
22
  end
19
23
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveAdmin
2
2
  module ActiveResource
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_active_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Roccoberton