activeadmin-tom_select 4.1.0

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.
Files changed (196) hide show
  1. checksums.yaml +7 -0
  2. data/.actrc +20 -0
  3. data/.claude/commands/fix-tests.md +203 -0
  4. data/.github/workflows/ci.yml +174 -0
  5. data/.github/workflows/npm-publish.yml +50 -0
  6. data/.gitignore +35 -0
  7. data/.npmignore +58 -0
  8. data/.rspec +1 -0
  9. data/.rubocop.yml +75 -0
  10. data/.yardopts +2 -0
  11. data/AGENTS.md +39 -0
  12. data/Appraisals +9 -0
  13. data/CHANGELOG.md +64 -0
  14. data/CLAUDE.md +157 -0
  15. data/Gemfile +12 -0
  16. data/Gemfile.lock +368 -0
  17. data/LICENSE.txt +25 -0
  18. data/README.md +483 -0
  19. data/Rakefile +4 -0
  20. data/activeadmin-tom_select.gemspec +43 -0
  21. data/bin/rspec +17 -0
  22. data/config/database.yml +16 -0
  23. data/docs/activeadmin-4-detailed-reference.md +932 -0
  24. data/docs/activeadmin-4-gem-migration-guide.md +313 -0
  25. data/docs/combustion.md +213 -0
  26. data/docs/fail.png +0 -0
  27. data/docs/guide-update-your-app.md +283 -0
  28. data/docs/normal.png +0 -0
  29. data/docs/propshaft-readme.md +320 -0
  30. data/docs/propshaft-upgrade.md +484 -0
  31. data/docs/setup-activeadmin-app.md +552 -0
  32. data/docs/setup-activeadmin-gem.md +535 -0
  33. data/docs/tailwind/blog-page.md +341 -0
  34. data/docs/tailwind/upgrade-guide-enhanced.md +438 -0
  35. data/docs/tailwind/upgrade-guide.md +416 -0
  36. data/docs/tailwind-4/active_admin.rake +38 -0
  37. data/docs/tailwind-4/active_admin.tailwind.css +415 -0
  38. data/docs/tailwind-4/tailwind-active_admin.config.js +18 -0
  39. data/docs/test-app-change.md +154 -0
  40. data/docs/test-environment-fixes.md +58 -0
  41. data/docs/update-tom-select.md +184 -0
  42. data/docs/upload-system.md +225 -0
  43. data/gemfiles/rails_7.x_active_admin_4.x.gemfile +10 -0
  44. data/gemfiles/rails_7.x_active_admin_4.x.gemfile.lock +377 -0
  45. data/gemfiles/rails_8.x_active_admin_4.x.gemfile +10 -0
  46. data/gemfiles/rails_8.x_active_admin_4.x.gemfile.lock +372 -0
  47. data/lefthook.yml +17 -0
  48. data/lib/activeadmin/inputs/filters/searchable_select_input.rb +19 -0
  49. data/lib/activeadmin/inputs/searchable_select_input.rb +16 -0
  50. data/lib/activeadmin/tom_select/engine.rb +17 -0
  51. data/lib/activeadmin/tom_select/option_collection.rb +128 -0
  52. data/lib/activeadmin/tom_select/resource_dsl_extension.rb +56 -0
  53. data/lib/activeadmin/tom_select/resource_extension.rb +10 -0
  54. data/lib/activeadmin/tom_select/select_input_extension.rb +168 -0
  55. data/lib/activeadmin/tom_select/version.rb +5 -0
  56. data/lib/activeadmin/tom_select.rb +20 -0
  57. data/lib/activeadmin-tom_select.rb +5 -0
  58. data/lib/generators/active_admin/tom_select/install/install_generator.rb +180 -0
  59. data/npm-package/package-lock.json +51 -0
  60. data/npm-package/package.json +43 -0
  61. data/npm-package/src/index.js +153 -0
  62. data/npm-package/src/tom-select-tailwind.css +392 -0
  63. data/sonar-project.properties +25 -0
  64. data/spec/features/ajax_params_spec.rb +31 -0
  65. data/spec/features/asset_pipeline_diagnostic_spec.rb +155 -0
  66. data/spec/features/end_to_end_spec.rb +273 -0
  67. data/spec/features/filter_input_spec.rb +144 -0
  68. data/spec/features/form_input_spec.rb +122 -0
  69. data/spec/features/inline_ajax_setting_spec.rb +26 -0
  70. data/spec/features/input_errors_spec.rb +76 -0
  71. data/spec/features/input_html_options_spec.rb +30 -0
  72. data/spec/features/options_dsl_spec.rb +230 -0
  73. data/spec/features/production_build_spec.rb +108 -0
  74. data/spec/internal/.node-version +1 -0
  75. data/spec/internal/Gemfile +43 -0
  76. data/spec/internal/Gemfile.lock +333 -0
  77. data/spec/internal/Procfile.dev +3 -0
  78. data/spec/internal/README.md +24 -0
  79. data/spec/internal/Rakefile +6 -0
  80. data/spec/internal/app/admin/categories.rb +26 -0
  81. data/spec/internal/app/admin/dashboard.rb +29 -0
  82. data/spec/internal/app/admin/option_types.rb +19 -0
  83. data/spec/internal/app/admin/option_values.rb +30 -0
  84. data/spec/internal/app/admin/posts.rb +27 -0
  85. data/spec/internal/app/admin/products.rb +22 -0
  86. data/spec/internal/app/admin/rgb_colors.rb +25 -0
  87. data/spec/internal/app/admin/tag_names.rb +21 -0
  88. data/spec/internal/app/admin/test_ajax_params_category.rb +10 -0
  89. data/spec/internal/app/admin/test_ajax_params_post.rb +20 -0
  90. data/spec/internal/app/admin/test_form_post_class.rb +7 -0
  91. data/spec/internal/app/admin/test_form_post_custom.rb +11 -0
  92. data/spec/internal/app/admin/test_form_post_resource.rb +11 -0
  93. data/spec/internal/app/admin/test_form_post_resource_custom.rb +12 -0
  94. data/spec/internal/app/admin/test_inline_ajax_post.rb +9 -0
  95. data/spec/internal/app/admin/test_input_html_post.rb +11 -0
  96. data/spec/internal/app/admin/test_posts_display_text.rb +9 -0
  97. data/spec/internal/app/admin/test_posts_filter.rb +9 -0
  98. data/spec/internal/app/admin/test_posts_named.rb +9 -0
  99. data/spec/internal/app/admin/test_posts_pagination.rb +9 -0
  100. data/spec/internal/app/admin/test_posts_payload_lambda.rb +11 -0
  101. data/spec/internal/app/admin/test_posts_payload_proc.rb +9 -0
  102. data/spec/internal/app/admin/test_posts_scope_lambda.rb +8 -0
  103. data/spec/internal/app/admin/test_posts_scope_params.rb +8 -0
  104. data/spec/internal/app/admin/test_posts_scope_user.rb +8 -0
  105. data/spec/internal/app/admin/test_posts_text_attr.rb +5 -0
  106. data/spec/internal/app/admin/users.rb +23 -0
  107. data/spec/internal/app/admin/variants.rb +31 -0
  108. data/spec/internal/app/assets/config/manifest.js +2 -0
  109. data/spec/internal/app/assets/images/.keep +0 -0
  110. data/spec/internal/app/assets/stylesheets/active_admin.tailwind.css +16 -0
  111. data/spec/internal/app/assets/stylesheets/application.tailwind.css +15 -0
  112. data/spec/internal/app/controllers/application_controller.rb +9 -0
  113. data/spec/internal/app/controllers/concerns/.keep +0 -0
  114. data/spec/internal/app/helpers/application_helper.rb +2 -0
  115. data/spec/internal/app/javascript/active_admin.js +19 -0
  116. data/spec/internal/app/javascript/application.js +2 -0
  117. data/spec/internal/app/jobs/application_job.rb +7 -0
  118. data/spec/internal/app/mailers/application_mailer.rb +4 -0
  119. data/spec/internal/app/models/admin_user.rb +9 -0
  120. data/spec/internal/app/models/application_record.rb +3 -0
  121. data/spec/internal/app/models/article.rb +12 -0
  122. data/spec/internal/app/models/category.rb +12 -0
  123. data/spec/internal/app/models/color.rb +9 -0
  124. data/spec/internal/app/models/concerns/.keep +0 -0
  125. data/spec/internal/app/models/internal/tag_name.rb +14 -0
  126. data/spec/internal/app/models/internal_tag_name.rb +11 -0
  127. data/spec/internal/app/models/option_type.rb +12 -0
  128. data/spec/internal/app/models/option_value.rb +4 -0
  129. data/spec/internal/app/models/post.rb +15 -0
  130. data/spec/internal/app/models/product.rb +12 -0
  131. data/spec/internal/app/models/rgb_color.rb +16 -0
  132. data/spec/internal/app/models/tag.rb +12 -0
  133. data/spec/internal/app/models/tagging.rb +12 -0
  134. data/spec/internal/app/models/user.rb +12 -0
  135. data/spec/internal/app/models/variant.rb +12 -0
  136. data/spec/internal/app/views/layouts/application.html.erb +28 -0
  137. data/spec/internal/app/views/layouts/mailer.html.erb +13 -0
  138. data/spec/internal/app/views/layouts/mailer.text.erb +1 -0
  139. data/spec/internal/app/views/pwa/manifest.json.erb +22 -0
  140. data/spec/internal/app/views/pwa/service-worker.js +26 -0
  141. data/spec/internal/bin/bundle +117 -0
  142. data/spec/internal/bin/dev +11 -0
  143. data/spec/internal/bin/rackup +27 -0
  144. data/spec/internal/bin/rails +4 -0
  145. data/spec/internal/bin/rake +4 -0
  146. data/spec/internal/bin/setup +37 -0
  147. data/spec/internal/config/application.rb +50 -0
  148. data/spec/internal/config/boot.rb +3 -0
  149. data/spec/internal/config/credentials.yml.enc +1 -0
  150. data/spec/internal/config/database.yml +32 -0
  151. data/spec/internal/config/environment.rb +5 -0
  152. data/spec/internal/config/environments/development.rb +63 -0
  153. data/spec/internal/config/environments/production.rb +86 -0
  154. data/spec/internal/config/environments/test.rb +50 -0
  155. data/spec/internal/config/initializers/active_admin.rb +54 -0
  156. data/spec/internal/config/initializers/assets.rb +8 -0
  157. data/spec/internal/config/initializers/content_security_policy.rb +25 -0
  158. data/spec/internal/config/initializers/devise.rb +315 -0
  159. data/spec/internal/config/initializers/filter_parameter_logging.rb +8 -0
  160. data/spec/internal/config/initializers/inflections.rb +16 -0
  161. data/spec/internal/config/initializers/searchable_select.rb +6 -0
  162. data/spec/internal/config/locales/devise.en.yml +65 -0
  163. data/spec/internal/config/locales/en.yml +31 -0
  164. data/spec/internal/config/master.key +1 -0
  165. data/spec/internal/config/puma.rb +38 -0
  166. data/spec/internal/config/routes.rb +17 -0
  167. data/spec/internal/config.ru +6 -0
  168. data/spec/internal/db/schema.rb +174 -0
  169. data/spec/internal/db/seeds.rb +167 -0
  170. data/spec/internal/esbuild.config.js +34 -0
  171. data/spec/internal/lib/tasks/.keep +0 -0
  172. data/spec/internal/lib/tasks/active_admin.rake +55 -0
  173. data/spec/internal/log/.keep +0 -0
  174. data/spec/internal/package-lock.json +1954 -0
  175. data/spec/internal/package.json +21 -0
  176. data/spec/internal/public/400.html +114 -0
  177. data/spec/internal/public/404.html +114 -0
  178. data/spec/internal/public/406-unsupported-browser.html +114 -0
  179. data/spec/internal/public/422.html +114 -0
  180. data/spec/internal/public/500.html +114 -0
  181. data/spec/internal/public/icon.png +0 -0
  182. data/spec/internal/public/icon.svg +3 -0
  183. data/spec/internal/public/robots.txt +1 -0
  184. data/spec/internal/script/.keep +0 -0
  185. data/spec/internal/storage/.keep +0 -0
  186. data/spec/internal/tailwind.config.js +23 -0
  187. data/spec/internal/vendor/.keep +0 -0
  188. data/spec/internal/yarn.lock +824 -0
  189. data/spec/rails_helper.rb +62 -0
  190. data/spec/spec_helper.rb +138 -0
  191. data/spec/support/active_admin_helpers.rb +17 -0
  192. data/spec/support/capybara.rb +8 -0
  193. data/spec/support/models.rb +11 -0
  194. data/spec/support/pluck_polyfill.rb +12 -0
  195. data/spec/support/reset_settings.rb +5 -0
  196. metadata +497 -0
@@ -0,0 +1,333 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ activeadmin-tom_select (4.1.0)
5
+ activeadmin (>= 3.0, < 5)
6
+ ransack (>= 1.8, < 5)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actioncable (8.0.2.1)
12
+ actionpack (= 8.0.2.1)
13
+ activesupport (= 8.0.2.1)
14
+ nio4r (~> 2.0)
15
+ websocket-driver (>= 0.6.1)
16
+ zeitwerk (~> 2.6)
17
+ actionmailbox (8.0.2.1)
18
+ actionpack (= 8.0.2.1)
19
+ activejob (= 8.0.2.1)
20
+ activerecord (= 8.0.2.1)
21
+ activestorage (= 8.0.2.1)
22
+ activesupport (= 8.0.2.1)
23
+ mail (>= 2.8.0)
24
+ actionmailer (8.0.2.1)
25
+ actionpack (= 8.0.2.1)
26
+ actionview (= 8.0.2.1)
27
+ activejob (= 8.0.2.1)
28
+ activesupport (= 8.0.2.1)
29
+ mail (>= 2.8.0)
30
+ rails-dom-testing (~> 2.2)
31
+ actionpack (8.0.2.1)
32
+ actionview (= 8.0.2.1)
33
+ activesupport (= 8.0.2.1)
34
+ nokogiri (>= 1.8.5)
35
+ rack (>= 2.2.4)
36
+ rack-session (>= 1.0.1)
37
+ rack-test (>= 0.6.3)
38
+ rails-dom-testing (~> 2.2)
39
+ rails-html-sanitizer (~> 1.6)
40
+ useragent (~> 0.16)
41
+ actiontext (8.0.2.1)
42
+ actionpack (= 8.0.2.1)
43
+ activerecord (= 8.0.2.1)
44
+ activestorage (= 8.0.2.1)
45
+ activesupport (= 8.0.2.1)
46
+ globalid (>= 0.6.0)
47
+ nokogiri (>= 1.8.5)
48
+ actionview (8.0.2.1)
49
+ activesupport (= 8.0.2.1)
50
+ builder (~> 3.1)
51
+ erubi (~> 1.11)
52
+ rails-dom-testing (~> 2.2)
53
+ rails-html-sanitizer (~> 1.6)
54
+ activeadmin (4.0.0.beta16)
55
+ arbre (~> 2.0)
56
+ csv
57
+ formtastic (>= 5.0)
58
+ formtastic_i18n (>= 0.7)
59
+ inherited_resources (~> 2.0)
60
+ kaminari (>= 1.2.1)
61
+ railties (>= 7.0)
62
+ ransack (>= 4.0)
63
+ activejob (8.0.2.1)
64
+ activesupport (= 8.0.2.1)
65
+ globalid (>= 0.3.6)
66
+ activemodel (8.0.2.1)
67
+ activesupport (= 8.0.2.1)
68
+ activerecord (8.0.2.1)
69
+ activemodel (= 8.0.2.1)
70
+ activesupport (= 8.0.2.1)
71
+ timeout (>= 0.4.0)
72
+ activestorage (8.0.2.1)
73
+ actionpack (= 8.0.2.1)
74
+ activejob (= 8.0.2.1)
75
+ activerecord (= 8.0.2.1)
76
+ activesupport (= 8.0.2.1)
77
+ marcel (~> 1.0)
78
+ activesupport (8.0.2.1)
79
+ base64
80
+ benchmark (>= 0.3)
81
+ bigdecimal
82
+ concurrent-ruby (~> 1.0, >= 1.3.1)
83
+ connection_pool (>= 2.2.5)
84
+ drb
85
+ i18n (>= 1.6, < 2)
86
+ logger (>= 1.4.2)
87
+ minitest (>= 5.1)
88
+ securerandom (>= 0.3)
89
+ tzinfo (~> 2.0, >= 2.0.5)
90
+ uri (>= 0.13.1)
91
+ addressable (2.8.7)
92
+ public_suffix (>= 2.0.2, < 7.0)
93
+ arbre (2.2.0)
94
+ activesupport (>= 7.0)
95
+ base64 (0.3.0)
96
+ bcrypt (3.1.20)
97
+ benchmark (0.4.1)
98
+ bigdecimal (3.2.3)
99
+ bindex (0.8.1)
100
+ builder (3.3.0)
101
+ capybara (3.40.0)
102
+ addressable
103
+ matrix
104
+ mini_mime (>= 0.1.3)
105
+ nokogiri (~> 1.11)
106
+ rack (>= 1.6.0)
107
+ rack-test (>= 0.6.3)
108
+ regexp_parser (>= 1.5, < 3.0)
109
+ xpath (~> 3.2)
110
+ capybara-playwright-driver (0.5.7)
111
+ addressable
112
+ capybara
113
+ playwright-ruby-client (>= 1.16.0)
114
+ concurrent-ruby (1.3.5)
115
+ connection_pool (2.5.4)
116
+ crass (1.0.6)
117
+ cssbundling-rails (1.4.3)
118
+ railties (>= 6.0.0)
119
+ csv (3.3.5)
120
+ database_cleaner-active_record (2.2.2)
121
+ activerecord (>= 5.a)
122
+ database_cleaner-core (~> 2.0)
123
+ database_cleaner-core (2.0.1)
124
+ date (3.4.1)
125
+ debug (1.11.0)
126
+ irb (~> 1.10)
127
+ reline (>= 0.3.8)
128
+ devise (4.9.4)
129
+ bcrypt (~> 3.0)
130
+ orm_adapter (~> 0.1)
131
+ railties (>= 4.1.0)
132
+ responders
133
+ warden (~> 1.2.3)
134
+ diff-lcs (1.6.2)
135
+ drb (2.2.3)
136
+ erb (5.0.2)
137
+ erubi (1.13.1)
138
+ formtastic (5.0.0)
139
+ actionpack (>= 6.0.0)
140
+ formtastic_i18n (0.7.0)
141
+ globalid (1.2.1)
142
+ activesupport (>= 6.1)
143
+ has_scope (0.8.2)
144
+ actionpack (>= 5.2)
145
+ activesupport (>= 5.2)
146
+ i18n (1.14.7)
147
+ concurrent-ruby (~> 1.0)
148
+ inherited_resources (2.1.0)
149
+ actionpack (>= 7.0)
150
+ has_scope (>= 0.6)
151
+ railties (>= 7.0)
152
+ responders (>= 2)
153
+ io-console (0.8.1)
154
+ irb (1.15.2)
155
+ pp (>= 0.6.0)
156
+ rdoc (>= 4.0.0)
157
+ reline (>= 0.4.2)
158
+ jsbundling-rails (1.3.1)
159
+ railties (>= 6.0.0)
160
+ kaminari (1.2.2)
161
+ activesupport (>= 4.1.0)
162
+ kaminari-actionview (= 1.2.2)
163
+ kaminari-activerecord (= 1.2.2)
164
+ kaminari-core (= 1.2.2)
165
+ kaminari-actionview (1.2.2)
166
+ actionview
167
+ kaminari-core (= 1.2.2)
168
+ kaminari-activerecord (1.2.2)
169
+ activerecord
170
+ kaminari-core (= 1.2.2)
171
+ kaminari-core (1.2.2)
172
+ logger (1.7.0)
173
+ loofah (2.24.1)
174
+ crass (~> 1.0.2)
175
+ nokogiri (>= 1.12.0)
176
+ mail (2.8.1)
177
+ mini_mime (>= 0.1.1)
178
+ net-imap
179
+ net-pop
180
+ net-smtp
181
+ marcel (1.0.4)
182
+ matrix (0.4.3)
183
+ mime-types (3.7.0)
184
+ logger
185
+ mime-types-data (~> 3.2025, >= 3.2025.0507)
186
+ mime-types-data (3.2025.0909)
187
+ mini_mime (1.1.5)
188
+ minitest (5.25.5)
189
+ net-imap (0.5.10)
190
+ date
191
+ net-protocol
192
+ net-pop (0.1.2)
193
+ net-protocol
194
+ net-protocol (0.2.2)
195
+ timeout
196
+ net-smtp (0.5.1)
197
+ net-protocol
198
+ nio4r (2.7.4)
199
+ nokogiri (1.18.9-x86_64-linux-gnu)
200
+ racc (~> 1.4)
201
+ orm_adapter (0.5.0)
202
+ playwright-ruby-client (1.55.0)
203
+ concurrent-ruby (>= 1.1.6)
204
+ mime-types (>= 3.0)
205
+ pp (0.6.2)
206
+ prettyprint
207
+ prettyprint (0.2.0)
208
+ propshaft (1.2.1)
209
+ actionpack (>= 7.0.0)
210
+ activesupport (>= 7.0.0)
211
+ rack
212
+ psych (5.2.6)
213
+ date
214
+ stringio
215
+ public_suffix (6.0.2)
216
+ puma (7.0.2)
217
+ nio4r (~> 2.0)
218
+ racc (1.8.1)
219
+ rack (3.2.1)
220
+ rack-session (2.1.1)
221
+ base64 (>= 0.1.0)
222
+ rack (>= 3.0.0)
223
+ rack-test (2.2.0)
224
+ rack (>= 1.3)
225
+ rackup (2.2.1)
226
+ rack (>= 3)
227
+ rails (8.0.2.1)
228
+ actioncable (= 8.0.2.1)
229
+ actionmailbox (= 8.0.2.1)
230
+ actionmailer (= 8.0.2.1)
231
+ actionpack (= 8.0.2.1)
232
+ actiontext (= 8.0.2.1)
233
+ actionview (= 8.0.2.1)
234
+ activejob (= 8.0.2.1)
235
+ activemodel (= 8.0.2.1)
236
+ activerecord (= 8.0.2.1)
237
+ activestorage (= 8.0.2.1)
238
+ activesupport (= 8.0.2.1)
239
+ bundler (>= 1.15.0)
240
+ railties (= 8.0.2.1)
241
+ rails-dom-testing (2.3.0)
242
+ activesupport (>= 5.0.0)
243
+ minitest
244
+ nokogiri (>= 1.6)
245
+ rails-html-sanitizer (1.6.2)
246
+ loofah (~> 2.21)
247
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
248
+ railties (8.0.2.1)
249
+ actionpack (= 8.0.2.1)
250
+ activesupport (= 8.0.2.1)
251
+ irb (~> 1.13)
252
+ rackup (>= 1.0.0)
253
+ rake (>= 12.2)
254
+ thor (~> 1.0, >= 1.2.2)
255
+ zeitwerk (~> 2.6)
256
+ rake (13.3.0)
257
+ ransack (4.3.0)
258
+ activerecord (>= 6.1.5)
259
+ activesupport (>= 6.1.5)
260
+ i18n
261
+ rdoc (6.14.2)
262
+ erb
263
+ psych (>= 4.0.0)
264
+ regexp_parser (2.11.2)
265
+ reline (0.6.2)
266
+ io-console (~> 0.5)
267
+ responders (3.1.1)
268
+ actionpack (>= 5.2)
269
+ railties (>= 5.2)
270
+ rspec-core (3.13.5)
271
+ rspec-support (~> 3.13.0)
272
+ rspec-expectations (3.13.5)
273
+ diff-lcs (>= 1.2.0, < 2.0)
274
+ rspec-support (~> 3.13.0)
275
+ rspec-mocks (3.13.5)
276
+ diff-lcs (>= 1.2.0, < 2.0)
277
+ rspec-support (~> 3.13.0)
278
+ rspec-rails (6.1.5)
279
+ actionpack (>= 6.1)
280
+ activesupport (>= 6.1)
281
+ railties (>= 6.1)
282
+ rspec-core (~> 3.13)
283
+ rspec-expectations (~> 3.13)
284
+ rspec-mocks (~> 3.13)
285
+ rspec-support (~> 3.13)
286
+ rspec-support (3.13.5)
287
+ securerandom (0.4.1)
288
+ sqlite3 (2.7.3-x86_64-linux-gnu)
289
+ stringio (3.1.7)
290
+ thor (1.4.0)
291
+ timeout (0.4.3)
292
+ tzinfo (2.0.6)
293
+ concurrent-ruby (~> 1.0)
294
+ uri (1.0.3)
295
+ useragent (0.16.11)
296
+ warden (1.2.9)
297
+ rack (>= 2.0.9)
298
+ web-console (4.2.1)
299
+ actionview (>= 6.0.0)
300
+ activemodel (>= 6.0.0)
301
+ bindex (>= 0.4.0)
302
+ railties (>= 6.0.0)
303
+ websocket-driver (0.8.0)
304
+ base64
305
+ websocket-extensions (>= 0.1.0)
306
+ websocket-extensions (0.1.5)
307
+ xpath (3.2.0)
308
+ nokogiri (~> 1.8)
309
+ zeitwerk (2.7.3)
310
+
311
+ PLATFORMS
312
+ x86_64-linux
313
+
314
+ DEPENDENCIES
315
+ activeadmin (~> 4.0.0.beta)
316
+ activeadmin-tom_select!
317
+ capybara (~> 3.39)
318
+ capybara-playwright-driver (~> 0.5)
319
+ cssbundling-rails
320
+ database_cleaner-active_record (~> 2.1)
321
+ debug
322
+ devise
323
+ jsbundling-rails
324
+ propshaft
325
+ puma (>= 5.0)
326
+ rails (~> 8.0.2, >= 8.0.2.1)
327
+ rspec-rails (~> 6.0)
328
+ sqlite3 (>= 2.1)
329
+ tzinfo-data
330
+ web-console
331
+
332
+ BUNDLED WITH
333
+ 2.4.10
@@ -0,0 +1,3 @@
1
+ web: env RUBY_DEBUG_OPEN=true bin/rails server
2
+ js: yarn build --watch
3
+ css: yarn build:css --watch
@@ -0,0 +1,24 @@
1
+ # README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative 'config/application'
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,26 @@
1
+ ActiveAdmin.register Category do
2
+ permit_params :name, :description, :created_at, :updated_at
3
+
4
+ searchable_select_options(scope: Category, text_attribute: :name)
5
+ searchable_select_options(name: 'custom', scope: Category, text_attribute: :name)
6
+
7
+ index do
8
+ selectable_column
9
+ id_column
10
+ column :name
11
+ column :description
12
+ column :created_at
13
+ actions
14
+ end
15
+
16
+ filter :name
17
+ filter :description
18
+
19
+ form do |f|
20
+ f.inputs do
21
+ f.input :name
22
+ f.input :description
23
+ end
24
+ f.actions
25
+ end
26
+ end
@@ -0,0 +1,29 @@
1
+ ActiveAdmin.register_page 'Dashboard' do
2
+ menu priority: 1, label: proc { I18n.t('active_admin.dashboard') }
3
+
4
+ content title: proc { I18n.t('active_admin.dashboard') } do
5
+ div class: 'blank_slate_container', id: 'dashboard_default_message' do
6
+ span class: 'blank_slate' do
7
+ span 'Welcome to ActiveAdmin Searchable Select Test App'
8
+ small 'This is a test application for manually testing the searchable select functionality'
9
+ end
10
+ end
11
+
12
+ panel 'Info' do
13
+ ul do
14
+ li "Posts: #{Post.count}"
15
+ li "Categories: #{Category.count}"
16
+ li "Users: #{User.count}"
17
+ li "RGB Colors: #{RgbColor.count}"
18
+ end
19
+ end
20
+
21
+ panel 'Recent Posts' do
22
+ ul do
23
+ Post.limit(5).map do |post|
24
+ li link_to(post.title, admin_post_path(post))
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,19 @@
1
+ ActiveAdmin.register OptionType do
2
+ permit_params :name
3
+
4
+ index do
5
+ selectable_column
6
+ id_column
7
+ column :name
8
+ actions
9
+ end
10
+
11
+ filter :name
12
+
13
+ form do |f|
14
+ f.inputs do
15
+ f.input :name
16
+ end
17
+ f.actions
18
+ end
19
+ end
@@ -0,0 +1,30 @@
1
+ ActiveAdmin.register OptionValue do
2
+ belongs_to :option_type
3
+
4
+ permit_params :value, :option_type_id
5
+
6
+ searchable_select_options(scope: lambda do |params|
7
+ OptionValue.where(
8
+ option_type_id: params[:option_type_id]
9
+ )
10
+ end,
11
+ text_attribute: :value)
12
+
13
+ index do
14
+ selectable_column
15
+ id_column
16
+ column :value
17
+ column :option_type
18
+ actions
19
+ end
20
+
21
+ filter :value
22
+
23
+ form do |f|
24
+ f.inputs do
25
+ f.input :value
26
+ f.input :option_type
27
+ end
28
+ f.actions
29
+ end
30
+ end
@@ -0,0 +1,27 @@
1
+ ActiveAdmin.register Post do
2
+ permit_params :title, :body, :category_id, :user_id, :created_at, :updated_at
3
+
4
+ index do
5
+ selectable_column
6
+ id_column
7
+ column :title
8
+ column :category
9
+ column :user
10
+ column :created_at
11
+ actions
12
+ end
13
+
14
+ filter :title
15
+ filter :category, as: :searchable_select, ajax: true
16
+ filter :user, as: :searchable_select, ajax: true
17
+
18
+ form do |f|
19
+ f.inputs do
20
+ f.input :title
21
+ f.input :body
22
+ f.input :category, as: :searchable_select, ajax: true
23
+ f.input :user, as: :searchable_select, ajax: true
24
+ end
25
+ f.actions
26
+ end
27
+ end
@@ -0,0 +1,22 @@
1
+ ActiveAdmin.register Product do
2
+ permit_params :name, :option_type_id
3
+
4
+ index do
5
+ selectable_column
6
+ id_column
7
+ column :name
8
+ column :option_type
9
+ actions
10
+ end
11
+
12
+ filter :name
13
+ filter :option_type
14
+
15
+ form do |f|
16
+ f.inputs do
17
+ f.input :name
18
+ f.input :option_type
19
+ end
20
+ f.actions
21
+ end
22
+ end
@@ -0,0 +1,25 @@
1
+ ActiveAdmin.register RgbColor do
2
+ permit_params :code, :description
3
+
4
+ searchable_select_options(scope: RgbColor.all,
5
+ text_attribute: :display_name)
6
+
7
+ index do
8
+ selectable_column
9
+ id_column
10
+ column :code
11
+ column :description
12
+ actions
13
+ end
14
+
15
+ filter :code
16
+ filter :description
17
+
18
+ form do |f|
19
+ f.inputs do
20
+ f.input :code
21
+ f.input :description
22
+ end
23
+ f.actions
24
+ end
25
+ end
@@ -0,0 +1,21 @@
1
+ ActiveAdmin.register Internal::TagName, as: 'Tag Name' do
2
+ permit_params :name, :color_id
3
+
4
+ index do
5
+ selectable_column
6
+ id_column
7
+ column :name
8
+ column :color
9
+ actions
10
+ end
11
+
12
+ filter :color, as: :searchable_select, ajax: { resource: RgbColor }
13
+
14
+ form do |f|
15
+ f.inputs do
16
+ f.input :name
17
+ f.input :color, as: :searchable_select, ajax: { resource: RgbColor }
18
+ end
19
+ f.actions
20
+ end
21
+ end
@@ -0,0 +1,10 @@
1
+ # Admin for testing ajax params with custom scope
2
+ ActiveAdmin.register Category, as: 'TestAjaxParamsCategory' do
3
+ menu false
4
+ searchable_select_options(
5
+ scope: lambda do |params|
6
+ Category.where(created_by_id: params[:created_by])
7
+ end,
8
+ text_attribute: :name
9
+ )
10
+ end
@@ -0,0 +1,20 @@
1
+ # Admin for testing ajax params with form
2
+ ActiveAdmin.register Post, as: 'TestAjaxParamsPost' do
3
+ menu false
4
+ controller do
5
+ def current_user
6
+ ApplicationController.current_user
7
+ end
8
+ end
9
+
10
+ form do |f|
11
+ f.input(:category,
12
+ as: :searchable_select,
13
+ ajax: {
14
+ resource: 'TestAjaxParamsCategory',
15
+ params: {
16
+ created_by: current_user.id
17
+ }
18
+ })
19
+ end
20
+ end
@@ -0,0 +1,7 @@
1
+ # Admin for testing form input with custom class attribute
2
+ ActiveAdmin.register Post, as: 'TestFormPostClass' do
3
+ menu false
4
+ form do |f|
5
+ f.input :category, as: :searchable_select, input_html: { class: 'custom' }
6
+ end
7
+ end
@@ -0,0 +1,11 @@
1
+ # Admin for testing form input with custom collection name
2
+ ActiveAdmin.register Post, as: 'TestFormPostCustom' do
3
+ menu false
4
+ form do |f|
5
+ f.input(:category,
6
+ as: :searchable_select,
7
+ ajax: {
8
+ collection_name: 'custom'
9
+ })
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # Admin for testing form input with resource passed in ajax option
2
+ ActiveAdmin.register Post, as: 'TestFormPostResource' do
3
+ menu false
4
+ form do |f|
5
+ f.input(:category_id,
6
+ as: :searchable_select,
7
+ ajax: {
8
+ resource: Category
9
+ })
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ # Admin for testing form input with resource and custom collection name
2
+ ActiveAdmin.register Post, as: 'TestFormPostResourceCustom' do
3
+ menu false
4
+ form do |f|
5
+ f.input(:category_id,
6
+ as: :searchable_select,
7
+ ajax: {
8
+ resource: Category,
9
+ collection_name: 'custom'
10
+ })
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ # Admin for testing inline_ajax_options setting
2
+ ActiveAdmin.register Post, as: 'TestInlineAjaxPost' do
3
+ menu false
4
+ form do |f|
5
+ f.input(:category,
6
+ as: :searchable_select,
7
+ ajax: true)
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ # Admin for testing input_html options
2
+ ActiveAdmin.register Post, as: 'TestInputHtmlPost' do
3
+ menu false
4
+ permit_params :title, :category_id
5
+
6
+ form do |f|
7
+ f.input :title
8
+ f.input :category, as: :searchable_select, input_html: { class: 'custom-class' },
9
+ ajax: { resource: Category }
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ # Admin for testing searchable_select_options with display_text option
2
+ ActiveAdmin.register Post, as: 'TestPostDisplayText' do
3
+ menu false
4
+ searchable_select_options(
5
+ scope: Post,
6
+ display_text: ->(record) { record.title.upcase },
7
+ text_attribute: :title
8
+ )
9
+ end