compony 0.6.2 → 0.6.3

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 (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/Gemfile.lock +1 -1
  4. data/VERSION +1 -1
  5. data/compony.gemspec +2 -2
  6. data/doc/ComponentGenerator.html +1 -1
  7. data/doc/Components.html +1 -1
  8. data/doc/ComponentsGenerator.html +1 -1
  9. data/doc/Compony/Component.html +1 -1
  10. data/doc/Compony/ComponentMixins/Default/Labelling.html +1 -1
  11. data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +1 -1
  12. data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +1 -1
  13. data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +1 -1
  14. data/doc/Compony/ComponentMixins/Default/Standalone.html +1 -1
  15. data/doc/Compony/ComponentMixins/Default.html +1 -1
  16. data/doc/Compony/ComponentMixins/Resourceful.html +1 -1
  17. data/doc/Compony/ComponentMixins.html +1 -1
  18. data/doc/Compony/Components/Button.html +1 -1
  19. data/doc/Compony/Components/Destroy.html +1 -1
  20. data/doc/Compony/Components/Edit.html +1 -1
  21. data/doc/Compony/Components/Form.html +1 -1
  22. data/doc/Compony/Components/Index.html +1 -1
  23. data/doc/Compony/Components/List.html +1 -1
  24. data/doc/Compony/Components/New.html +1 -1
  25. data/doc/Compony/Components/Show.html +1 -1
  26. data/doc/Compony/Components/WithForm.html +1 -1
  27. data/doc/Compony/Components.html +1 -1
  28. data/doc/Compony/ControllerMixin.html +1 -1
  29. data/doc/Compony/Engine.html +1 -1
  30. data/doc/Compony/MethodAccessibleHash.html +1 -1
  31. data/doc/Compony/ModelFields/Anchormodel.html +1 -1
  32. data/doc/Compony/ModelFields/Association.html +1 -1
  33. data/doc/Compony/ModelFields/Attachment.html +30 -20
  34. data/doc/Compony/ModelFields/Base.html +1 -1
  35. data/doc/Compony/ModelFields/Boolean.html +1 -1
  36. data/doc/Compony/ModelFields/Color.html +1 -1
  37. data/doc/Compony/ModelFields/Currency.html +1 -1
  38. data/doc/Compony/ModelFields/Date.html +1 -1
  39. data/doc/Compony/ModelFields/Datetime.html +1 -1
  40. data/doc/Compony/ModelFields/Decimal.html +1 -1
  41. data/doc/Compony/ModelFields/Email.html +1 -1
  42. data/doc/Compony/ModelFields/Float.html +1 -1
  43. data/doc/Compony/ModelFields/Integer.html +1 -1
  44. data/doc/Compony/ModelFields/Percentage.html +1 -1
  45. data/doc/Compony/ModelFields/Phone.html +1 -1
  46. data/doc/Compony/ModelFields/RichText.html +1 -1
  47. data/doc/Compony/ModelFields/String.html +1 -1
  48. data/doc/Compony/ModelFields/Text.html +1 -1
  49. data/doc/Compony/ModelFields/Time.html +1 -1
  50. data/doc/Compony/ModelFields/Url.html +1 -1
  51. data/doc/Compony/ModelFields.html +1 -1
  52. data/doc/Compony/ModelMixin.html +1 -1
  53. data/doc/Compony/NaturalOrdering.html +1 -1
  54. data/doc/Compony/RequestContext.html +1 -1
  55. data/doc/Compony/Version.html +1 -1
  56. data/doc/Compony/ViewHelpers.html +1 -1
  57. data/doc/Compony.html +1 -1
  58. data/doc/ComponyController.html +1 -1
  59. data/doc/_index.html +1 -1
  60. data/doc/file.README.html +1 -1
  61. data/doc/index.html +1 -1
  62. data/doc/top-level-namespace.html +1 -1
  63. data/lib/compony/model_fields/attachment.rb +18 -13
  64. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c257df59f05eaa09355fcacafaba9a7c68aa71cbe5d5ad23ead5c5b21f8fa96
4
- data.tar.gz: 102c34b3cd592ebb8e091f59bded17d78de24ba72937518c2ddc114de5e0ba54
3
+ metadata.gz: fe868fddf616f93152f70cb5ab1254b8dbc1117e63fcfba23253b169445caf98
4
+ data.tar.gz: a3e03f6e2a133b365e78be592ac0b948c7d7dd8636f3fbd5306dd7325ad4dcce
5
5
  SHA512:
6
- metadata.gz: 9ba30014ff523c9ec837f415bc532d3d93d07a18dbd85326fcf24470185a5ef8d1e9a603b06101107490a6eb60419923571ada909162b018a81fce104c4706ac
7
- data.tar.gz: 302ae98bfb03eb9416276b630ba1d92b3b4b327ef6736de2f6f9bb004bb661c2fb554f6cbcc1f80eeeb2124a7cec0a3813aceee09e1eaca194a7f25726f4f5a2
6
+ metadata.gz: 84176f87d5a47e5addf50cf73479e8b44f95c0f8d3917c9ae60714cef07fd04ee3d8a9313e802414680d7ee8f944f090b8ba3f2633f626a150663986279de8c4
7
+ data.tar.gz: 4018cc46cfcc1ccd4c97f1cb8cc1bf9f9b2455ab33a8c3f8bf9947de1cb85300c25d34e41953c91141fc87d06296f4a2835a0d964c2b7be81869cb0094e06024
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.6.3
2
+
3
+ - Restrict multi-attachments to upload only when the form's object is a new record
4
+
1
5
  # 0.6.2
2
6
 
3
7
  - Change download link label of attachments from "Download" to the actual filename
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- compony (0.6.2.edge)
4
+ compony (0.6.3.edge)
5
5
  anchormodel (~> 0.2.1)
6
6
  cancancan (~> 3.6.1)
7
7
  dslblend (>= 0.0.3)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.2
1
+ 0.6.3
data/compony.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
  # This file is auto-generated via: 'rake gemspec'.
3
3
 
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: compony 0.6.2 ruby lib
5
+ # stub: compony 0.6.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "compony".freeze
9
- s.version = "0.6.2".freeze
9
+ s.version = "0.6.3".freeze
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
@@ -249,7 +249,7 @@
249
249
  </div>
250
250
 
251
251
  <div id="footer">
252
- Generated on Wed Sep 17 11:13:07 2025 by
252
+ Generated on Thu Sep 25 13:03:52 2025 by
253
253
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
254
254
  0.9.34 (ruby-3.3.5).
255
255
  </div>
data/doc/Components.html CHANGED
@@ -95,7 +95,7 @@
95
95
  </div>
96
96
 
97
97
  <div id="footer">
98
- Generated on Wed Sep 17 11:13:06 2025 by
98
+ Generated on Thu Sep 25 13:03:51 2025 by
99
99
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
100
100
  0.9.34 (ruby-3.3.5).
101
101
  </div>
@@ -193,7 +193,7 @@
193
193
  </div>
194
194
 
195
195
  <div id="footer">
196
- Generated on Wed Sep 17 11:13:07 2025 by
196
+ Generated on Thu Sep 25 13:03:52 2025 by
197
197
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
198
198
  0.9.34 (ruby-3.3.5).
199
199
  </div>
@@ -2243,7 +2243,7 @@
2243
2243
  </div>
2244
2244
 
2245
2245
  <div id="footer">
2246
- Generated on Wed Sep 17 11:13:06 2025 by
2246
+ Generated on Thu Sep 25 13:03:51 2025 by
2247
2247
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2248
2248
  0.9.34 (ruby-3.3.5).
2249
2249
  </div>
@@ -396,7 +396,7 @@
396
396
  </div>
397
397
 
398
398
  <div id="footer">
399
- Generated on Wed Sep 17 11:13:06 2025 by
399
+ Generated on Thu Sep 25 13:03:51 2025 by
400
400
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
401
401
  0.9.34 (ruby-3.3.5).
402
402
  </div>
@@ -529,7 +529,7 @@
529
529
  </div>
530
530
 
531
531
  <div id="footer">
532
- Generated on Wed Sep 17 11:13:07 2025 by
532
+ Generated on Thu Sep 25 13:03:52 2025 by
533
533
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
534
534
  0.9.34 (ruby-3.3.5).
535
535
  </div>
@@ -659,7 +659,7 @@
659
659
  </div>
660
660
 
661
661
  <div id="footer">
662
- Generated on Wed Sep 17 11:13:07 2025 by
662
+ Generated on Thu Sep 25 13:03:52 2025 by
663
663
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
664
664
  0.9.34 (ruby-3.3.5).
665
665
  </div>
@@ -567,7 +567,7 @@
567
567
  </div>
568
568
 
569
569
  <div id="footer">
570
- Generated on Wed Sep 17 11:13:07 2025 by
570
+ Generated on Thu Sep 25 13:03:52 2025 by
571
571
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
572
572
  0.9.34 (ruby-3.3.5).
573
573
  </div>
@@ -682,7 +682,7 @@
682
682
  </div>
683
683
 
684
684
  <div id="footer">
685
- Generated on Wed Sep 17 11:13:06 2025 by
685
+ Generated on Thu Sep 25 13:03:51 2025 by
686
686
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
687
687
  0.9.34 (ruby-3.3.5).
688
688
  </div>
@@ -116,7 +116,7 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Wed Sep 17 11:13:06 2025 by
119
+ Generated on Thu Sep 25 13:03:51 2025 by
120
120
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
121
  0.9.34 (ruby-3.3.5).
122
122
  </div>
@@ -1183,7 +1183,7 @@
1183
1183
  </div>
1184
1184
 
1185
1185
  <div id="footer">
1186
- Generated on Wed Sep 17 11:13:06 2025 by
1186
+ Generated on Thu Sep 25 13:03:51 2025 by
1187
1187
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1188
1188
  0.9.34 (ruby-3.3.5).
1189
1189
  </div>
@@ -116,7 +116,7 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Wed Sep 17 11:13:06 2025 by
119
+ Generated on Thu Sep 25 13:03:51 2025 by
120
120
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
121
  0.9.34 (ruby-3.3.5).
122
122
  </div>
@@ -287,7 +287,7 @@
287
287
  </div>
288
288
 
289
289
  <div id="footer">
290
- Generated on Wed Sep 17 11:13:07 2025 by
290
+ Generated on Thu Sep 25 13:03:52 2025 by
291
291
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
292
292
  0.9.34 (ruby-3.3.5).
293
293
  </div>
@@ -374,7 +374,7 @@
374
374
  </div>
375
375
 
376
376
  <div id="footer">
377
- Generated on Wed Sep 17 11:13:07 2025 by
377
+ Generated on Thu Sep 25 13:03:52 2025 by
378
378
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
379
379
  0.9.34 (ruby-3.3.5).
380
380
  </div>
@@ -452,7 +452,7 @@
452
452
  </div>
453
453
 
454
454
  <div id="footer">
455
- Generated on Wed Sep 17 11:13:06 2025 by
455
+ Generated on Thu Sep 25 13:03:51 2025 by
456
456
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
457
457
  0.9.34 (ruby-3.3.5).
458
458
  </div>
@@ -1482,7 +1482,7 @@
1482
1482
  </div>
1483
1483
 
1484
1484
  <div id="footer">
1485
- Generated on Wed Sep 17 11:13:06 2025 by
1485
+ Generated on Thu Sep 25 13:03:51 2025 by
1486
1486
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1487
1487
  0.9.34 (ruby-3.3.5).
1488
1488
  </div>
@@ -162,7 +162,7 @@
162
162
  </div>
163
163
 
164
164
  <div id="footer">
165
- Generated on Wed Sep 17 11:13:07 2025 by
165
+ Generated on Thu Sep 25 13:03:52 2025 by
166
166
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
167
167
  0.9.34 (ruby-3.3.5).
168
168
  </div>
@@ -2810,7 +2810,7 @@
2810
2810
  </div>
2811
2811
 
2812
2812
  <div id="footer">
2813
- Generated on Wed Sep 17 11:13:07 2025 by
2813
+ Generated on Thu Sep 25 13:03:51 2025 by
2814
2814
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2815
2815
  0.9.34 (ruby-3.3.5).
2816
2816
  </div>
@@ -452,7 +452,7 @@
452
452
  </div>
453
453
 
454
454
  <div id="footer">
455
- Generated on Wed Sep 17 11:13:06 2025 by
455
+ Generated on Thu Sep 25 13:03:51 2025 by
456
456
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
457
457
  0.9.34 (ruby-3.3.5).
458
458
  </div>
@@ -730,7 +730,7 @@
730
730
  </div>
731
731
 
732
732
  <div id="footer">
733
- Generated on Wed Sep 17 11:13:07 2025 by
733
+ Generated on Thu Sep 25 13:03:52 2025 by
734
734
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
735
735
  0.9.34 (ruby-3.3.5).
736
736
  </div>
@@ -593,7 +593,7 @@
593
593
  </div>
594
594
 
595
595
  <div id="footer">
596
- Generated on Wed Sep 17 11:13:07 2025 by
596
+ Generated on Thu Sep 25 13:03:52 2025 by
597
597
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
598
598
  0.9.34 (ruby-3.3.5).
599
599
  </div>
@@ -116,7 +116,7 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Wed Sep 17 11:13:06 2025 by
119
+ Generated on Thu Sep 25 13:03:51 2025 by
120
120
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
121
  0.9.34 (ruby-3.3.5).
122
122
  </div>
@@ -126,7 +126,7 @@
126
126
  </div>
127
127
 
128
128
  <div id="footer">
129
- Generated on Wed Sep 17 11:13:06 2025 by
129
+ Generated on Thu Sep 25 13:03:51 2025 by
130
130
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
131
131
  0.9.34 (ruby-3.3.5).
132
132
  </div>
@@ -123,7 +123,7 @@
123
123
  </div>
124
124
 
125
125
  <div id="footer">
126
- Generated on Wed Sep 17 11:13:06 2025 by
126
+ Generated on Thu Sep 25 13:03:51 2025 by
127
127
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
128
128
  0.9.34 (ruby-3.3.5).
129
129
  </div>
@@ -443,7 +443,7 @@ instance_of_a_hash.roo --&gt; nil
443
443
  </div>
444
444
 
445
445
  <div id="footer">
446
- Generated on Wed Sep 17 11:13:07 2025 by
446
+ Generated on Thu Sep 25 13:03:52 2025 by
447
447
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
448
448
  0.9.34 (ruby-3.3.5).
449
449
  </div>
@@ -509,7 +509,7 @@
509
509
  </div>
510
510
 
511
511
  <div id="footer">
512
- Generated on Wed Sep 17 11:13:07 2025 by
512
+ Generated on Thu Sep 25 13:03:52 2025 by
513
513
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
514
514
  0.9.34 (ruby-3.3.5).
515
515
  </div>
@@ -603,7 +603,7 @@
603
603
  </div>
604
604
 
605
605
  <div id="footer">
606
- Generated on Wed Sep 17 11:13:07 2025 by
606
+ Generated on Thu Sep 25 13:03:52 2025 by
607
607
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
608
608
  0.9.34 (ruby-3.3.5).
609
609
  </div>
@@ -319,13 +319,13 @@
319
319
  <pre class="lines">
320
320
 
321
321
 
322
- 53
323
- 54
324
- 55
325
- 56</pre>
322
+ 58
323
+ 59
324
+ 60
325
+ 61</pre>
326
326
  </td>
327
327
  <td>
328
- <pre class="code"><span class="info file"># File 'lib/compony/model_fields/attachment.rb', line 53</span>
328
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/attachment.rb', line 58</span>
329
329
 
330
330
  <span class='kw'>def</span> <span class='id identifier rubyid_resolve_attachment!'>resolve_attachment!</span>
331
331
  <span class='id identifier rubyid_attachment_info'>attachment_info</span> <span class='op'>=</span> <span class='id identifier rubyid_model_class'>model_class</span><span class='period'>.</span><span class='id identifier rubyid_reflect_on_attachment'>reflect_on_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
@@ -383,7 +383,12 @@
383
383
  44
384
384
  45
385
385
  46
386
- 47</pre>
386
+ 47
387
+ 48
388
+ 49
389
+ 50
390
+ 51
391
+ 52</pre>
387
392
  </td>
388
393
  <td>
389
394
  <pre class="code"><span class="info file"># File 'lib/compony/model_fields/attachment.rb', line 24</span>
@@ -392,22 +397,27 @@
392
397
  <span class='id identifier rubyid_name'>name</span> <span class='op'>||=</span> <span class='ivar'>@name</span>
393
398
  <span class='id identifier rubyid_input_opts'>input_opts</span><span class='period'>.</span><span class='id identifier rubyid_deep_merge!'>deep_merge!</span><span class='lparen'>(</span><span class='label'>input_html:</span> <span class='lbrace'>{</span> <span class='label'>accept:</span> <span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_accept'>accept</span>
394
399
  <span class='kw'>if</span> <span class='ivar'>@multi</span>
395
- <span class='id identifier rubyid_helpers'>helpers</span> <span class='op'>=</span> <span class='const'>ActionController</span><span class='op'>::</span><span class='const'>Base</span><span class='period'>.</span><span class='id identifier rubyid_helpers'>helpers</span>
396
- <span class='kw'>return</span> <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_capture'>capture</span> <span class='kw'>do</span>
397
- <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_concat'>concat</span> <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_label'>label</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
398
- <span class='comment'># List currently present attachments along with a remove button (done in JS)
399
- </span> <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_div'>div</span> <span class='label'>class:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>compony-attachments-item-wrapper</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>do</span>
400
- <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_attachment'>attachment</span><span class='op'>|</span>
401
- <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_div'>div</span> <span class='label'>class:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>compony-attachments-item</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>do</span>
402
- <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_concat'>concat</span> <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_hidden_field_tag'>hidden_field_tag</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_model_name'>model_name</span><span class='period'>.</span><span class='id identifier rubyid_singular'>singular</span><span class='embexpr_end'>}</span><span class='tstring_content'>[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>][]</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_signed_id'>signed_id</span><span class='rparen'>)</span>
403
- <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_span'>span</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='label'>class:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>compony-attachments-filename</span><span class='tstring_end'>&#39;</span></span>
404
- <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_span'>span</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'> </span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>class:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>compony-attachments-spacer</span><span class='tstring_end'>&#39;</span></span>
405
- <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_concat'>concat</span> <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_link_to'>link_to</span><span class='lparen'>(</span><span class='const'>I18n</span><span class='period'>.</span><span class='id identifier rubyid_t'>t</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>compony.model_fields.attachment.remove</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>#</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
406
- <span class='label'>onclick:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>event.preventDefault(); this.closest(&#39;div&#39;).remove();</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
400
+ <span class='kw'>if</span> <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_new_record?'>new_record?</span>
401
+ <span class='comment'># signed id is only calculated when the attachment is actually attached, cannot provide buttons for new records
402
+ </span> <span class='kw'>return</span> <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_input'>input</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_input_opts'>input_opts</span><span class='period'>.</span><span class='id identifier rubyid_deep_merge'>deep_merge</span><span class='lparen'>(</span><span class='label'>input_html:</span> <span class='lbrace'>{</span> <span class='label'>multiple:</span> <span class='symbol'>:multiple</span> <span class='rbrace'>}</span><span class='rparen'>)</span><span class='rparen'>)</span>
403
+ <span class='kw'>else</span>
404
+ <span class='id identifier rubyid_helpers'>helpers</span> <span class='op'>=</span> <span class='const'>ActionController</span><span class='op'>::</span><span class='const'>Base</span><span class='period'>.</span><span class='id identifier rubyid_helpers'>helpers</span>
405
+ <span class='kw'>return</span> <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_capture'>capture</span> <span class='kw'>do</span>
406
+ <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_concat'>concat</span> <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_label'>label</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
407
+ <span class='comment'># List currently present attachments along with a remove button (done in JS)
408
+ </span> <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_div'>div</span> <span class='label'>class:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>compony-attachments-item-wrapper</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>do</span>
409
+ <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_attachment'>attachment</span><span class='op'>|</span>
410
+ <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_div'>div</span> <span class='label'>class:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>compony-attachments-item</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>do</span>
411
+ <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_concat'>concat</span> <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_hidden_field_tag'>hidden_field_tag</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_model_name'>model_name</span><span class='period'>.</span><span class='id identifier rubyid_singular'>singular</span><span class='embexpr_end'>}</span><span class='tstring_content'>[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>][]</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_signed_id'>signed_id</span><span class='rparen'>)</span>
412
+ <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_span'>span</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='label'>class:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>compony-attachments-filename</span><span class='tstring_end'>&#39;</span></span>
413
+ <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_span'>span</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'> </span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>class:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>compony-attachments-spacer</span><span class='tstring_end'>&#39;</span></span>
414
+ <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_concat'>concat</span> <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_link_to'>link_to</span><span class='lparen'>(</span><span class='const'>I18n</span><span class='period'>.</span><span class='id identifier rubyid_t'>t</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>compony.model_fields.attachment.remove</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>#</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
415
+ <span class='label'>onclick:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>event.preventDefault(); this.closest(&#39;div&#39;).remove();</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
416
+ <span class='kw'>end</span>
407
417
  <span class='kw'>end</span>
408
418
  <span class='kw'>end</span>
419
+ <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_concat'>concat</span> <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_input'>input</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_input_opts'>input_opts</span><span class='period'>.</span><span class='id identifier rubyid_deep_merge'>deep_merge</span><span class='lparen'>(</span><span class='label'>input_html:</span> <span class='lbrace'>{</span> <span class='label'>multiple:</span> <span class='symbol'>:multiple</span> <span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>label:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='label'>class:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>compony-attachments-input</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
409
420
  <span class='kw'>end</span>
410
- <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_concat'>concat</span> <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_input'>input</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_input_opts'>input_opts</span><span class='period'>.</span><span class='id identifier rubyid_deep_merge'>deep_merge</span><span class='lparen'>(</span><span class='label'>input_html:</span> <span class='lbrace'>{</span> <span class='label'>multiple:</span> <span class='symbol'>:multiple</span> <span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>label:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='label'>class:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>compony-attachments-input</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
411
421
  <span class='kw'>end</span>
412
422
  <span class='kw'>end</span>
413
423
  <span class='kw'>return</span> <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_input'>input</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_input_opts'>input_opts</span><span class='rparen'>)</span>
@@ -479,7 +489,7 @@
479
489
  </div>
480
490
 
481
491
  <div id="footer">
482
- Generated on Wed Sep 17 11:13:07 2025 by
492
+ Generated on Thu Sep 25 13:03:52 2025 by
483
493
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
484
494
  0.9.34 (ruby-3.3.5).
485
495
  </div>
@@ -1186,7 +1186,7 @@
1186
1186
  </div>
1187
1187
 
1188
1188
  <div id="footer">
1189
- Generated on Wed Sep 17 11:13:07 2025 by
1189
+ Generated on Thu Sep 25 13:03:52 2025 by
1190
1190
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1191
1191
  0.9.34 (ruby-3.3.5).
1192
1192
  </div>
@@ -354,7 +354,7 @@
354
354
  </div>
355
355
 
356
356
  <div id="footer">
357
- Generated on Wed Sep 17 11:13:07 2025 by
357
+ Generated on Thu Sep 25 13:03:52 2025 by
358
358
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
359
359
  0.9.34 (ruby-3.3.5).
360
360
  </div>
@@ -289,7 +289,7 @@
289
289
  </div>
290
290
 
291
291
  <div id="footer">
292
- Generated on Wed Sep 17 11:13:07 2025 by
292
+ Generated on Thu Sep 25 13:03:52 2025 by
293
293
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
294
294
  0.9.34 (ruby-3.3.5).
295
295
  </div>
@@ -222,7 +222,7 @@
222
222
  </div>
223
223
 
224
224
  <div id="footer">
225
- Generated on Wed Sep 17 11:13:07 2025 by
225
+ Generated on Thu Sep 25 13:03:52 2025 by
226
226
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
227
227
  0.9.34 (ruby-3.3.5).
228
228
  </div>
@@ -222,7 +222,7 @@
222
222
  </div>
223
223
 
224
224
  <div id="footer">
225
- Generated on Wed Sep 17 11:13:07 2025 by
225
+ Generated on Thu Sep 25 13:03:52 2025 by
226
226
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
227
227
  0.9.34 (ruby-3.3.5).
228
228
  </div>
@@ -222,7 +222,7 @@
222
222
  </div>
223
223
 
224
224
  <div id="footer">
225
- Generated on Wed Sep 17 11:13:07 2025 by
225
+ Generated on Thu Sep 25 13:03:52 2025 by
226
226
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
227
227
  0.9.34 (ruby-3.3.5).
228
228
  </div>
@@ -144,7 +144,7 @@
144
144
  </div>
145
145
 
146
146
  <div id="footer">
147
- Generated on Wed Sep 17 11:13:07 2025 by
147
+ Generated on Thu Sep 25 13:03:52 2025 by
148
148
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
149
149
  0.9.34 (ruby-3.3.5).
150
150
  </div>
@@ -230,7 +230,7 @@
230
230
  </div>
231
231
 
232
232
  <div id="footer">
233
- Generated on Wed Sep 17 11:13:07 2025 by
233
+ Generated on Thu Sep 25 13:03:52 2025 by
234
234
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
235
235
  0.9.34 (ruby-3.3.5).
236
236
  </div>
@@ -144,7 +144,7 @@
144
144
  </div>
145
145
 
146
146
  <div id="footer">
147
- Generated on Wed Sep 17 11:13:07 2025 by
147
+ Generated on Thu Sep 25 13:03:52 2025 by
148
148
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
149
149
  0.9.34 (ruby-3.3.5).
150
150
  </div>
@@ -222,7 +222,7 @@
222
222
  </div>
223
223
 
224
224
  <div id="footer">
225
- Generated on Wed Sep 17 11:13:07 2025 by
225
+ Generated on Thu Sep 25 13:03:52 2025 by
226
226
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
227
227
  0.9.34 (ruby-3.3.5).
228
228
  </div>
@@ -222,7 +222,7 @@
222
222
  </div>
223
223
 
224
224
  <div id="footer">
225
- Generated on Wed Sep 17 11:13:07 2025 by
225
+ Generated on Thu Sep 25 13:03:52 2025 by
226
226
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
227
227
  0.9.34 (ruby-3.3.5).
228
228
  </div>
@@ -291,7 +291,7 @@
291
291
  </div>
292
292
 
293
293
  <div id="footer">
294
- Generated on Wed Sep 17 11:13:07 2025 by
294
+ Generated on Thu Sep 25 13:03:52 2025 by
295
295
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
296
296
  0.9.34 (ruby-3.3.5).
297
297
  </div>
@@ -222,7 +222,7 @@
222
222
  </div>
223
223
 
224
224
  <div id="footer">
225
- Generated on Wed Sep 17 11:13:07 2025 by
225
+ Generated on Thu Sep 25 13:03:52 2025 by
226
226
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
227
227
  0.9.34 (ruby-3.3.5).
228
228
  </div>
@@ -144,7 +144,7 @@
144
144
  </div>
145
145
 
146
146
  <div id="footer">
147
- Generated on Wed Sep 17 11:13:07 2025 by
147
+ Generated on Thu Sep 25 13:03:52 2025 by
148
148
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
149
149
  0.9.34 (ruby-3.3.5).
150
150
  </div>
@@ -144,7 +144,7 @@
144
144
  </div>
145
145
 
146
146
  <div id="footer">
147
- Generated on Wed Sep 17 11:13:07 2025 by
147
+ Generated on Thu Sep 25 13:03:52 2025 by
148
148
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
149
149
  0.9.34 (ruby-3.3.5).
150
150
  </div>
@@ -144,7 +144,7 @@
144
144
  </div>
145
145
 
146
146
  <div id="footer">
147
- Generated on Wed Sep 17 11:13:07 2025 by
147
+ Generated on Thu Sep 25 13:03:52 2025 by
148
148
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
149
149
  0.9.34 (ruby-3.3.5).
150
150
  </div>
@@ -230,7 +230,7 @@
230
230
  </div>
231
231
 
232
232
  <div id="footer">
233
- Generated on Wed Sep 17 11:13:07 2025 by
233
+ Generated on Thu Sep 25 13:03:52 2025 by
234
234
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
235
235
  0.9.34 (ruby-3.3.5).
236
236
  </div>
@@ -116,7 +116,7 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Wed Sep 17 11:13:06 2025 by
119
+ Generated on Thu Sep 25 13:03:51 2025 by
120
120
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
121
  0.9.34 (ruby-3.3.5).
122
122
  </div>
@@ -514,7 +514,7 @@
514
514
  </div>
515
515
 
516
516
  <div id="footer">
517
- Generated on Wed Sep 17 11:13:06 2025 by
517
+ Generated on Thu Sep 25 13:03:51 2025 by
518
518
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
519
519
  0.9.34 (ruby-3.3.5).
520
520
  </div>
@@ -290,7 +290,7 @@
290
290
  </div>
291
291
 
292
292
  <div id="footer">
293
- Generated on Wed Sep 17 11:13:07 2025 by
293
+ Generated on Thu Sep 25 13:03:52 2025 by
294
294
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
295
295
  0.9.34 (ruby-3.3.5).
296
296
  </div>
@@ -931,7 +931,7 @@
931
931
  </div>
932
932
 
933
933
  <div id="footer">
934
- Generated on Wed Sep 17 11:13:07 2025 by
934
+ Generated on Thu Sep 25 13:03:52 2025 by
935
935
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
936
936
  0.9.34 (ruby-3.3.5).
937
937
  </div>
@@ -129,7 +129,7 @@
129
129
  </div>
130
130
 
131
131
  <div id="footer">
132
- Generated on Wed Sep 17 11:13:06 2025 by
132
+ Generated on Thu Sep 25 13:03:51 2025 by
133
133
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
134
134
  0.9.34 (ruby-3.3.5).
135
135
  </div>
@@ -479,7 +479,7 @@
479
479
  </div>
480
480
 
481
481
  <div id="footer">
482
- Generated on Wed Sep 17 11:13:06 2025 by
482
+ Generated on Thu Sep 25 13:03:51 2025 by
483
483
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
484
484
  0.9.34 (ruby-3.3.5).
485
485
  </div>
data/doc/Compony.html CHANGED
@@ -2206,7 +2206,7 @@
2206
2206
  </div>
2207
2207
 
2208
2208
  <div id="footer">
2209
- Generated on Wed Sep 17 11:13:06 2025 by
2209
+ Generated on Thu Sep 25 13:03:51 2025 by
2210
2210
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2211
2211
  0.9.34 (ruby-3.3.5).
2212
2212
  </div>
@@ -114,7 +114,7 @@
114
114
  </div>
115
115
 
116
116
  <div id="footer">
117
- Generated on Wed Sep 17 11:13:07 2025 by
117
+ Generated on Thu Sep 25 13:03:52 2025 by
118
118
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119
119
  0.9.34 (ruby-3.3.5).
120
120
  </div>
data/doc/_index.html CHANGED
@@ -587,7 +587,7 @@
587
587
  </div>
588
588
 
589
589
  <div id="footer">
590
- Generated on Wed Sep 17 11:13:03 2025 by
590
+ Generated on Thu Sep 25 13:03:48 2025 by
591
591
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
592
592
  0.9.34 (ruby-3.3.5).
593
593
  </div>
data/doc/file.README.html CHANGED
@@ -1779,7 +1779,7 @@ my_button = Compony.button(:index, :users, enabled: -&gt; { |controller| control
1779
1779
  </div></div>
1780
1780
 
1781
1781
  <div id="footer">
1782
- Generated on Wed Sep 17 11:13:06 2025 by
1782
+ Generated on Thu Sep 25 13:03:51 2025 by
1783
1783
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1784
1784
  0.9.34 (ruby-3.3.5).
1785
1785
  </div>
data/doc/index.html CHANGED
@@ -1779,7 +1779,7 @@ my_button = Compony.button(:index, :users, enabled: -&gt; { |controller| control
1779
1779
  </div></div>
1780
1780
 
1781
1781
  <div id="footer">
1782
- Generated on Wed Sep 17 11:13:04 2025 by
1782
+ Generated on Thu Sep 25 13:03:49 2025 by
1783
1783
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1784
1784
  0.9.34 (ruby-3.3.5).
1785
1785
  </div>
@@ -102,7 +102,7 @@
102
102
  </div>
103
103
 
104
104
  <div id="footer">
105
- Generated on Wed Sep 17 11:13:06 2025 by
105
+ Generated on Thu Sep 25 13:03:51 2025 by
106
106
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
107
107
  0.9.34 (ruby-3.3.5).
108
108
  </div>
@@ -25,22 +25,27 @@ module Compony
25
25
  name ||= @name
26
26
  input_opts.deep_merge!(input_html: { accept: }) if accept
27
27
  if @multi
28
- helpers = ActionController::Base.helpers
29
- return helpers.capture do
30
- helpers.concat form.label(name)
31
- # List currently present attachments along with a remove button (done in JS)
32
- helpers.div class: 'compony-attachments-item-wrapper' do
33
- form.object.send(name).each do |attachment|
34
- helpers.div class: 'compony-attachments-item' do
35
- helpers.concat helpers.hidden_field_tag("#{form.object.model_name.singular}[#{name}][]", attachment.signed_id)
36
- helpers.span attachment.filename, class: 'compony-attachments-filename'
37
- helpers.span ' ', class: 'compony-attachments-spacer'
38
- helpers.concat helpers.link_to(I18n.t('compony.model_fields.attachment.remove'), '#',
39
- onclick: "event.preventDefault(); this.closest('div').remove();")
28
+ if form.object.new_record?
29
+ # signed id is only calculated when the attachment is actually attached, cannot provide buttons for new records
30
+ return form.input(name, **input_opts.deep_merge(input_html: { multiple: :multiple }))
31
+ else
32
+ helpers = ActionController::Base.helpers
33
+ return helpers.capture do
34
+ helpers.concat form.label(name)
35
+ # List currently present attachments along with a remove button (done in JS)
36
+ helpers.div class: 'compony-attachments-item-wrapper' do
37
+ form.object.send(name).each do |attachment|
38
+ helpers.div class: 'compony-attachments-item' do
39
+ helpers.concat helpers.hidden_field_tag("#{form.object.model_name.singular}[#{name}][]", attachment.signed_id)
40
+ helpers.span attachment.filename, class: 'compony-attachments-filename'
41
+ helpers.span ' ', class: 'compony-attachments-spacer'
42
+ helpers.concat helpers.link_to(I18n.t('compony.model_fields.attachment.remove'), '#',
43
+ onclick: "event.preventDefault(); this.closest('div').remove();")
44
+ end
40
45
  end
41
46
  end
47
+ helpers.concat form.input(name, **input_opts.deep_merge(input_html: { multiple: :multiple }, label: false, class: 'compony-attachments-input'))
42
48
  end
43
- helpers.concat form.input(name, **input_opts.deep_merge(input_html: { multiple: :multiple }, label: false, class: 'compony-attachments-input'))
44
49
  end
45
50
  end
46
51
  return form.input(name, **input_opts)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compony
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Kalbermatter