rails_admin_tag_list 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 614ab64869f76d073241333bd070eea676e8daa2
4
- data.tar.gz: 1c90897236400f2e6222b7ef1ba7becce56e69a4
2
+ SHA256:
3
+ metadata.gz: b8d45a872444ad383ed50087ce9cd0d2d44f47a0cbdcaa4bbc2cf6467d98fb3b
4
+ data.tar.gz: eb00101aec4a765b176b1dacb3cd3b5271c3a4b6508f625a37d37d930a43a50a
5
5
  SHA512:
6
- metadata.gz: 0ada63826b3c409b79da17fabd82c232fe624be1e60172e360bb959ff0c9340017ff06c228c33094a194893b42570c4842654fcf764bfe951aa7a7a1e97f1247
7
- data.tar.gz: 2f43199002c2f365b609205c8c903940df012f892973a1f6be92837b560e7c53456e1973d3887c8540f39c3772a57b0819637caf09b9f0a70c39187cda6603b0
6
+ metadata.gz: d11abc6337f57d14cbc8b5540004a6c2c1379ebb2a78c3d17d7fe2f55b7b687c419f0c05b4dbce6179530d38cd619fe02df27e07d48cf8cb64ef62d6915697ab
7
+ data.tar.gz: 3f6b2813833ade6bf17bfb272ff6a057fafe48228beeb6c43f62f2706a8dbd9c9c32e74126690c43ada08b17d5d8e920b9abbeefaec0eabfd6baae926b81514b
data/README.md CHANGED
@@ -1,3 +1,8 @@
1
+ DEPRECATED
2
+ ==========
3
+
4
+ This plugin is no longer supported.
5
+
1
6
  Introduction
2
7
  ============
3
8
 
@@ -10,13 +15,17 @@ Installation
10
15
 
11
16
  In your `Gemfile`:
12
17
 
13
- gem 'rails_admin'
14
- gem 'rails_admin_tag_list'
18
+ ```ruby
19
+ gem 'rails_admin'
20
+ gem 'rails_admin_tag_list'
21
+ ```
15
22
 
16
23
  and run:
17
24
 
18
25
  $ bundle install
19
26
 
27
+ Check [acts_as_taggable_on](https://github.com/mbleigh/acts-as-taggable-on) docs in order to install it properly.
28
+
20
29
  Usage and Configuration
21
30
  =======================
22
31
 
@@ -27,15 +36,12 @@ rails_admin_tag_list by default does the following:
27
36
 
28
37
  There is your model:
29
38
 
30
- class Player < ActiveRecord::Base
31
- attr_accessible :name
32
- attr_accessible :tag_list, :skill_list
33
-
34
- acts_as_taggable
35
- acts_as_taggable_on :skills
36
- end
37
-
38
-
39
+ ```ruby
40
+ class Player < ActiveRecord::Base
41
+ acts_as_taggable
42
+ acts_as_taggable_on :skills
43
+ end
44
+ ```
39
45
 
40
46
  > *Note that tag_list (skill_list, etc.) attribute should be available for mass-assignment by rails_admin users.*
41
47
 
@@ -47,56 +53,64 @@ There is your model:
47
53
 
48
54
  In addition to default field view (named `form_tag_list`) this gem provides two custom views `tag_list_with_suggestions` and `tag_list_with_autocomplete`. To enable any of them specify partial name:
49
55
 
50
- RailsAdmin.config do |config|
51
- config.model Player do
52
- edit do
53
- fields_of_type :tag_list do
54
- partial 'tag_list_with_suggestions'
55
-
56
- # the option sets max count of suggestions (default is 100); set -1 to abolish the limit
57
- ratl_max_suggestions -1
58
- end
59
- end
56
+ ```ruby
57
+ RailsAdmin.config do |config|
58
+ config.model Player do
59
+ edit do
60
+ fields_of_type :tag_list do
61
+ partial 'tag_list_with_suggestions'
62
+
63
+ # the option sets max count of suggestions (default is 100); set -1 to abolish the limit
64
+ ratl_max_suggestions -1
60
65
  end
61
66
  end
67
+ end
68
+ end
69
+ ```
62
70
 
63
71
  You can do with tag_list fields whatever what allows to do rails_admin:
64
72
 
65
- **rename lable**
73
+ **rename label**
66
74
 
67
- RailsAdmin.config do |config|
68
- config.model Player do
69
- edit do
70
- field :tag_list do
71
- label "Tags"
72
- end
73
- field :skill_list
74
- end
75
+ ```ruby
76
+ RailsAdmin.config do |config|
77
+ config.model Player do
78
+ edit do
79
+ field :tag_list do
80
+ label "Tags"
75
81
  end
82
+ field :skill_list
76
83
  end
84
+ end
85
+ end
86
+ ```
77
87
 
78
88
  **hide all tag_list fields**
79
89
 
80
- RailsAdmin.config do |config|
81
- config.model Player do
82
- edit do
83
- fields_of_type :tag_list do
84
- hide
85
- end
86
- end
90
+ ```ruby
91
+ RailsAdmin.config do |config|
92
+ config.model Player do
93
+ edit do
94
+ fields_of_type :tag_list do
95
+ hide
87
96
  end
88
97
  end
98
+ end
99
+ end
100
+ ```
89
101
 
90
102
  **reassing partial**
91
103
 
92
- RailsAdmin.config do |config|
93
- config.model Player do
94
- edit do
95
- fields_of_type :tag_list do
96
- partial 'awesome_tag_list'
97
- end
98
- end
104
+ ```ruby
105
+ RailsAdmin.config do |config|
106
+ config.model Player do
107
+ edit do
108
+ fields_of_type :tag_list do
109
+ partial 'awesome_tag_list'
99
110
  end
100
111
  end
112
+ end
113
+ end
114
+ ```
101
115
 
102
- Create you custom partial and put it to `app/views/rails_admin/main/` in your own project folder
116
+ Create you custom partial and put it to `app/views/rails_admin/main/` in your own project folder. Check an [example](https://github.com/kryzhovnik/rails_admin_tag_list/blob/master/app/views/rails_admin/main/_tag_list_with_suggestions.html.haml)
@@ -12,12 +12,17 @@ module RailsAdmin
12
12
  module Types
13
13
  class TagList < RailsAdmin::Config::Fields::Base
14
14
  RailsAdmin::Config::Fields::Types::register(self)
15
+
16
+ def value
17
+ bindings[:object].send(name)
18
+ end
19
+
15
20
  register_instance_option(:formatted_value) do
16
- value.join(', ')
21
+ value && value.join(', ')
17
22
  end
18
23
 
19
24
  register_instance_option(:pretty_value) do
20
- value.join(', ')
25
+ value && value.join(', ')
21
26
  end
22
27
 
23
28
  # Accessor for field's label.
@@ -1,4 +1,9 @@
1
1
  module RailsAdminTagList
2
2
  class Engine < ::Rails::Engine
3
+ initializer 'rails_admin_rag_list.action_controller' do |app|
4
+ ActiveSupport.on_load :action_controller do
5
+ helper RailsAdminTagList::SuggestionsHelper
6
+ end
7
+ end
3
8
  end
4
9
  end
@@ -1,3 +1,3 @@
1
1
  module RailsAdminTagList
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_admin_tag_list
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Samsonov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-09 00:00:00.000000000 Z
11
+ date: 2020-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails_admin
@@ -73,10 +73,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  requirements: []
76
- rubyforge_project:
77
- rubygems_version: 2.4.5.1
76
+ rubygems_version: 3.1.2
78
77
  signing_key:
79
78
  specification_version: 4
80
79
  summary: Support acts_as_taggable_on gem for rails_admin
81
80
  test_files: []
82
- has_rdoc: