compony 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +6 -6
- data/README.md +36 -0
- data/VERSION +1 -1
- data/app/controllers/compony_controller.rb +4 -0
- data/compony.gemspec +4 -4
- data/doc/ComponentGenerator.html +1 -1
- data/doc/Components.html +1 -1
- data/doc/ComponentsGenerator.html +1 -1
- data/doc/Compony/Component.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Labelling.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +96 -27
- data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone.html +1 -1
- data/doc/Compony/ComponentMixins/Default.html +1 -1
- data/doc/Compony/ComponentMixins/Resourceful.html +1 -1
- data/doc/Compony/ComponentMixins.html +1 -1
- data/doc/Compony/Components/Button.html +1 -1
- data/doc/Compony/Components/Destroy.html +1 -1
- data/doc/Compony/Components/Edit.html +1 -1
- data/doc/Compony/Components/Form.html +210 -127
- data/doc/Compony/Components/New.html +1 -1
- data/doc/Compony/Components/WithForm.html +1 -1
- data/doc/Compony/Components.html +1 -1
- data/doc/Compony/ControllerMixin.html +1 -1
- data/doc/Compony/Engine.html +1 -1
- data/doc/Compony/MethodAccessibleHash.html +1 -1
- data/doc/Compony/ModelFields/Anchormodel.html +1 -1
- data/doc/Compony/ModelFields/Association.html +1 -1
- data/doc/Compony/ModelFields/Attachment.html +1 -1
- data/doc/Compony/ModelFields/Base.html +1 -1
- data/doc/Compony/ModelFields/Boolean.html +1 -1
- data/doc/Compony/ModelFields/Color.html +1 -1
- data/doc/Compony/ModelFields/Currency.html +1 -1
- data/doc/Compony/ModelFields/Date.html +1 -1
- data/doc/Compony/ModelFields/Datetime.html +1 -1
- data/doc/Compony/ModelFields/Decimal.html +1 -1
- data/doc/Compony/ModelFields/Email.html +1 -1
- data/doc/Compony/ModelFields/Float.html +1 -1
- data/doc/Compony/ModelFields/Integer.html +1 -1
- data/doc/Compony/ModelFields/Percentage.html +1 -1
- data/doc/Compony/ModelFields/Phone.html +1 -1
- data/doc/Compony/ModelFields/RichText.html +1 -1
- data/doc/Compony/ModelFields/String.html +1 -1
- data/doc/Compony/ModelFields/Text.html +1 -1
- data/doc/Compony/ModelFields/Time.html +1 -1
- data/doc/Compony/ModelFields/Url.html +1 -1
- data/doc/Compony/ModelFields.html +1 -1
- data/doc/Compony/ModelMixin.html +25 -25
- data/doc/Compony/NaturalOrdering.html +1 -1
- data/doc/Compony/RequestContext.html +1 -1
- data/doc/Compony/Version.html +1 -1
- data/doc/Compony/ViewHelpers.html +1 -1
- data/doc/Compony.html +3 -3
- data/doc/ComponyController.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +36 -1
- data/doc/index.html +36 -1
- data/doc/method_list.html +112 -96
- data/doc/top-level-namespace.html +1 -1
- data/lib/compony/component_mixins/default/standalone/standalone_dsl.rb +18 -10
- data/lib/compony/components/form.rb +49 -32
- data/lib/compony/model_mixin.rb +19 -13
- data/lib/compony.rb +2 -2
- metadata +3 -9
@@ -452,7 +452,7 @@
|
|
452
452
|
</div>
|
453
453
|
|
454
454
|
<div id="footer">
|
455
|
-
Generated on Fri
|
455
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
456
456
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
457
457
|
0.9.37 (ruby-3.3.5).
|
458
458
|
</div>
|
@@ -593,7 +593,7 @@
|
|
593
593
|
</div>
|
594
594
|
|
595
595
|
<div id="footer">
|
596
|
-
Generated on Fri
|
596
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
597
597
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
598
598
|
0.9.37 (ruby-3.3.5).
|
599
599
|
</div>
|
data/doc/Compony/Components.html
CHANGED
@@ -116,7 +116,7 @@
|
|
116
116
|
</div>
|
117
117
|
|
118
118
|
<div id="footer">
|
119
|
-
Generated on Fri
|
119
|
+
Generated on Fri Feb 14 13:24:11 2025 by
|
120
120
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
121
121
|
0.9.37 (ruby-3.3.5).
|
122
122
|
</div>
|
@@ -126,7 +126,7 @@
|
|
126
126
|
</div>
|
127
127
|
|
128
128
|
<div id="footer">
|
129
|
-
Generated on Fri
|
129
|
+
Generated on Fri Feb 14 13:24:11 2025 by
|
130
130
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
131
131
|
0.9.37 (ruby-3.3.5).
|
132
132
|
</div>
|
data/doc/Compony/Engine.html
CHANGED
@@ -123,7 +123,7 @@
|
|
123
123
|
</div>
|
124
124
|
|
125
125
|
<div id="footer">
|
126
|
-
Generated on Fri
|
126
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
127
127
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
128
128
|
0.9.37 (ruby-3.3.5).
|
129
129
|
</div>
|
@@ -443,7 +443,7 @@ instance_of_a_hash.roo --> nil
|
|
443
443
|
</div>
|
444
444
|
|
445
445
|
<div id="footer">
|
446
|
-
Generated on Fri
|
446
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
447
447
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
448
448
|
0.9.37 (ruby-3.3.5).
|
449
449
|
</div>
|
@@ -377,7 +377,7 @@
|
|
377
377
|
</div>
|
378
378
|
|
379
379
|
<div id="footer">
|
380
|
-
Generated on Fri
|
380
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
381
381
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
382
382
|
0.9.37 (ruby-3.3.5).
|
383
383
|
</div>
|
@@ -603,7 +603,7 @@
|
|
603
603
|
</div>
|
604
604
|
|
605
605
|
<div id="footer">
|
606
|
-
Generated on Fri
|
606
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
607
607
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
608
608
|
0.9.37 (ruby-3.3.5).
|
609
609
|
</div>
|
@@ -295,7 +295,7 @@
|
|
295
295
|
</div>
|
296
296
|
|
297
297
|
<div id="footer">
|
298
|
-
Generated on Fri
|
298
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
299
299
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
300
300
|
0.9.37 (ruby-3.3.5).
|
301
301
|
</div>
|
@@ -1056,7 +1056,7 @@
|
|
1056
1056
|
</div>
|
1057
1057
|
|
1058
1058
|
<div id="footer">
|
1059
|
-
Generated on Fri
|
1059
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
1060
1060
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1061
1061
|
0.9.37 (ruby-3.3.5).
|
1062
1062
|
</div>
|
@@ -222,7 +222,7 @@
|
|
222
222
|
</div>
|
223
223
|
|
224
224
|
<div id="footer">
|
225
|
-
Generated on Fri
|
225
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
226
226
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
227
227
|
0.9.37 (ruby-3.3.5).
|
228
228
|
</div>
|
@@ -289,7 +289,7 @@
|
|
289
289
|
</div>
|
290
290
|
|
291
291
|
<div id="footer">
|
292
|
-
Generated on Fri
|
292
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
293
293
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
294
294
|
0.9.37 (ruby-3.3.5).
|
295
295
|
</div>
|
@@ -222,7 +222,7 @@
|
|
222
222
|
</div>
|
223
223
|
|
224
224
|
<div id="footer">
|
225
|
-
Generated on Fri
|
225
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
226
226
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
227
227
|
0.9.37 (ruby-3.3.5).
|
228
228
|
</div>
|
@@ -222,7 +222,7 @@
|
|
222
222
|
</div>
|
223
223
|
|
224
224
|
<div id="footer">
|
225
|
-
Generated on Fri
|
225
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
226
226
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
227
227
|
0.9.37 (ruby-3.3.5).
|
228
228
|
</div>
|
@@ -222,7 +222,7 @@
|
|
222
222
|
</div>
|
223
223
|
|
224
224
|
<div id="footer">
|
225
|
-
Generated on Fri
|
225
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
226
226
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
227
227
|
0.9.37 (ruby-3.3.5).
|
228
228
|
</div>
|
@@ -144,7 +144,7 @@
|
|
144
144
|
</div>
|
145
145
|
|
146
146
|
<div id="footer">
|
147
|
-
Generated on Fri
|
147
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
148
148
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
149
149
|
0.9.37 (ruby-3.3.5).
|
150
150
|
</div>
|
@@ -230,7 +230,7 @@
|
|
230
230
|
</div>
|
231
231
|
|
232
232
|
<div id="footer">
|
233
|
-
Generated on Fri
|
233
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
234
234
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
235
235
|
0.9.37 (ruby-3.3.5).
|
236
236
|
</div>
|
@@ -144,7 +144,7 @@
|
|
144
144
|
</div>
|
145
145
|
|
146
146
|
<div id="footer">
|
147
|
-
Generated on Fri
|
147
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
148
148
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
149
149
|
0.9.37 (ruby-3.3.5).
|
150
150
|
</div>
|
@@ -144,7 +144,7 @@
|
|
144
144
|
</div>
|
145
145
|
|
146
146
|
<div id="footer">
|
147
|
-
Generated on Fri
|
147
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
148
148
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
149
149
|
0.9.37 (ruby-3.3.5).
|
150
150
|
</div>
|
@@ -222,7 +222,7 @@
|
|
222
222
|
</div>
|
223
223
|
|
224
224
|
<div id="footer">
|
225
|
-
Generated on Fri
|
225
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
226
226
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
227
227
|
0.9.37 (ruby-3.3.5).
|
228
228
|
</div>
|
@@ -291,7 +291,7 @@
|
|
291
291
|
</div>
|
292
292
|
|
293
293
|
<div id="footer">
|
294
|
-
Generated on Fri
|
294
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
295
295
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
296
296
|
0.9.37 (ruby-3.3.5).
|
297
297
|
</div>
|
@@ -222,7 +222,7 @@
|
|
222
222
|
</div>
|
223
223
|
|
224
224
|
<div id="footer">
|
225
|
-
Generated on Fri
|
225
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
226
226
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
227
227
|
0.9.37 (ruby-3.3.5).
|
228
228
|
</div>
|
@@ -144,7 +144,7 @@
|
|
144
144
|
</div>
|
145
145
|
|
146
146
|
<div id="footer">
|
147
|
-
Generated on Fri
|
147
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
148
148
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
149
149
|
0.9.37 (ruby-3.3.5).
|
150
150
|
</div>
|
@@ -144,7 +144,7 @@
|
|
144
144
|
</div>
|
145
145
|
|
146
146
|
<div id="footer">
|
147
|
-
Generated on Fri
|
147
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
148
148
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
149
149
|
0.9.37 (ruby-3.3.5).
|
150
150
|
</div>
|
@@ -144,7 +144,7 @@
|
|
144
144
|
</div>
|
145
145
|
|
146
146
|
<div id="footer">
|
147
|
-
Generated on Fri
|
147
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
148
148
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
149
149
|
0.9.37 (ruby-3.3.5).
|
150
150
|
</div>
|
@@ -230,7 +230,7 @@
|
|
230
230
|
</div>
|
231
231
|
|
232
232
|
<div id="footer">
|
233
|
-
Generated on Fri
|
233
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
234
234
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
235
235
|
0.9.37 (ruby-3.3.5).
|
236
236
|
</div>
|
@@ -116,7 +116,7 @@
|
|
116
116
|
</div>
|
117
117
|
|
118
118
|
<div id="footer">
|
119
|
-
Generated on Fri
|
119
|
+
Generated on Fri Feb 14 13:24:11 2025 by
|
120
120
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
121
121
|
0.9.37 (ruby-3.3.5).
|
122
122
|
</div>
|
data/doc/Compony/ModelMixin.html
CHANGED
@@ -264,14 +264,14 @@
|
|
264
264
|
<pre class="lines">
|
265
265
|
|
266
266
|
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
267
|
+
109
|
268
|
+
110
|
269
|
+
111
|
270
|
+
112
|
271
|
+
113</pre>
|
272
272
|
</td>
|
273
273
|
<td>
|
274
|
-
<pre class="code"><span class="info file"># File 'lib/compony/model_mixin.rb', line
|
274
|
+
<pre class="code"><span class="info file"># File 'lib/compony/model_mixin.rb', line 109</span>
|
275
275
|
|
276
276
|
<span class='kw'>def</span> <span class='id identifier rubyid_feasibility_messages'>feasibility_messages</span><span class='lparen'>(</span><span class='id identifier rubyid_action_name'>action_name</span><span class='rparen'>)</span>
|
277
277
|
<span class='id identifier rubyid_action_name'>action_name</span> <span class='op'>=</span> <span class='id identifier rubyid_action_name'>action_name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
@@ -360,12 +360,6 @@
|
|
360
360
|
<pre class="lines">
|
361
361
|
|
362
362
|
|
363
|
-
82
|
364
|
-
83
|
365
|
-
84
|
366
|
-
85
|
367
|
-
86
|
368
|
-
87
|
369
363
|
88
|
370
364
|
89
|
371
365
|
90
|
@@ -376,10 +370,16 @@
|
|
376
370
|
95
|
377
371
|
96
|
378
372
|
97
|
379
|
-
98
|
373
|
+
98
|
374
|
+
99
|
375
|
+
100
|
376
|
+
101
|
377
|
+
102
|
378
|
+
103
|
379
|
+
104</pre>
|
380
380
|
</td>
|
381
381
|
<td>
|
382
|
-
<pre class="code"><span class="info file"># File 'lib/compony/model_mixin.rb', line
|
382
|
+
<pre class="code"><span class="info file"># File 'lib/compony/model_mixin.rb', line 88</span>
|
383
383
|
|
384
384
|
<span class='kw'>def</span> <span class='id identifier rubyid_feasible?'>feasible?</span><span class='lparen'>(</span><span class='id identifier rubyid_action_name'>action_name</span><span class='comma'>,</span> <span class='label'>recompute:</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
385
385
|
<span class='id identifier rubyid_action_name'>action_name</span> <span class='op'>=</span> <span class='id identifier rubyid_action_name'>action_name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
@@ -429,12 +429,12 @@
|
|
429
429
|
<pre class="lines">
|
430
430
|
|
431
431
|
|
432
|
-
|
433
|
-
|
434
|
-
|
432
|
+
126
|
433
|
+
127
|
434
|
+
128</pre>
|
435
435
|
</td>
|
436
436
|
<td>
|
437
|
-
<pre class="code"><span class="info file"># File 'lib/compony/model_mixin.rb', line
|
437
|
+
<pre class="code"><span class="info file"># File 'lib/compony/model_mixin.rb', line 126</span>
|
438
438
|
|
439
439
|
<span class='kw'>def</span> <span class='id identifier rubyid_field'>field</span><span class='lparen'>(</span><span class='id identifier rubyid_field_name'>field_name</span><span class='comma'>,</span> <span class='id identifier rubyid_controller'>controller</span><span class='rparen'>)</span>
|
440
440
|
<span class='id identifier rubyid_fields'>fields</span><span class='lbracket'>[</span><span class='id identifier rubyid_field_name'>field_name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_value_for'>value_for</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='label'>controller:</span><span class='rparen'>)</span>
|
@@ -490,14 +490,14 @@
|
|
490
490
|
<pre class="lines">
|
491
491
|
|
492
492
|
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
493
|
+
119
|
494
|
+
120
|
495
|
+
121
|
496
|
+
122
|
497
|
+
123</pre>
|
498
498
|
</td>
|
499
499
|
<td>
|
500
|
-
<pre class="code"><span class="info file"># File 'lib/compony/model_mixin.rb', line
|
500
|
+
<pre class="code"><span class="info file"># File 'lib/compony/model_mixin.rb', line 119</span>
|
501
501
|
|
502
502
|
<span class='kw'>def</span> <span class='id identifier rubyid_full_feasibility_messages'>full_feasibility_messages</span><span class='lparen'>(</span><span class='id identifier rubyid_action_name'>action_name</span><span class='rparen'>)</span>
|
503
503
|
<span class='id identifier rubyid_text'>text</span> <span class='op'>=</span> <span class='id identifier rubyid_feasibility_messages'>feasibility_messages</span><span class='lparen'>(</span><span class='id identifier rubyid_action_name'>action_name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>, </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_upcase_first'>upcase_first</span>
|
@@ -514,7 +514,7 @@
|
|
514
514
|
</div>
|
515
515
|
|
516
516
|
<div id="footer">
|
517
|
-
Generated on Fri
|
517
|
+
Generated on Fri Feb 14 13:24:11 2025 by
|
518
518
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
519
519
|
0.9.37 (ruby-3.3.5).
|
520
520
|
</div>
|
@@ -290,7 +290,7 @@
|
|
290
290
|
</div>
|
291
291
|
|
292
292
|
<div id="footer">
|
293
|
-
Generated on Fri
|
293
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
294
294
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
295
295
|
0.9.37 (ruby-3.3.5).
|
296
296
|
</div>
|
@@ -931,7 +931,7 @@
|
|
931
931
|
</div>
|
932
932
|
|
933
933
|
<div id="footer">
|
934
|
-
Generated on Fri
|
934
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
935
935
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
936
936
|
0.9.37 (ruby-3.3.5).
|
937
937
|
</div>
|
data/doc/Compony/Version.html
CHANGED
@@ -129,7 +129,7 @@
|
|
129
129
|
</div>
|
130
130
|
|
131
131
|
<div id="footer">
|
132
|
-
Generated on Fri
|
132
|
+
Generated on Fri Feb 14 13:24:11 2025 by
|
133
133
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
134
134
|
0.9.37 (ruby-3.3.5).
|
135
135
|
</div>
|
@@ -451,7 +451,7 @@
|
|
451
451
|
</div>
|
452
452
|
|
453
453
|
<div id="footer">
|
454
|
-
Generated on Fri
|
454
|
+
Generated on Fri Feb 14 13:24:11 2025 by
|
455
455
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
456
456
|
0.9.37 (ruby-3.3.5).
|
457
457
|
</div>
|
data/doc/Compony.html
CHANGED
@@ -1379,7 +1379,7 @@
|
|
1379
1379
|
<p class="tag_title">See Also:</p>
|
1380
1380
|
<ul class="see">
|
1381
1381
|
|
1382
|
-
<li
|
1382
|
+
<li>#content_after_root_comp=</li>
|
1383
1383
|
|
1384
1384
|
</ul>
|
1385
1385
|
|
@@ -1470,7 +1470,7 @@
|
|
1470
1470
|
<p class="tag_title">See Also:</p>
|
1471
1471
|
<ul class="see">
|
1472
1472
|
|
1473
|
-
<li
|
1473
|
+
<li>#content_before_root_comp=</li>
|
1474
1474
|
|
1475
1475
|
</ul>
|
1476
1476
|
|
@@ -2206,7 +2206,7 @@
|
|
2206
2206
|
</div>
|
2207
2207
|
|
2208
2208
|
<div id="footer">
|
2209
|
-
Generated on Fri
|
2209
|
+
Generated on Fri Feb 14 13:24:11 2025 by
|
2210
2210
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2211
2211
|
0.9.37 (ruby-3.3.5).
|
2212
2212
|
</div>
|
data/doc/ComponyController.html
CHANGED
@@ -114,7 +114,7 @@
|
|
114
114
|
</div>
|
115
115
|
|
116
116
|
<div id="footer">
|
117
|
-
Generated on Fri
|
117
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
118
118
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
119
119
|
0.9.37 (ruby-3.3.5).
|
120
120
|
</div>
|
data/doc/_index.html
CHANGED
@@ -566,7 +566,7 @@
|
|
566
566
|
</div>
|
567
567
|
|
568
568
|
<div id="footer">
|
569
|
-
Generated on Fri
|
569
|
+
Generated on Fri Feb 14 13:24:09 2025 by
|
570
570
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
571
571
|
0.9.37 (ruby-3.3.5).
|
572
572
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -624,6 +624,8 @@
|
|
624
624
|
</li><li>
|
625
625
|
<p><code>skip_authentication!</code> which disables authentication, in case you provided some. You need to implement <code>authorize</code> regardless.</p>
|
626
626
|
</li><li>
|
627
|
+
<p><code>skip_forgery_protection!</code> which disables CSRF protection for the controller action generated for this standalone configuration.</p>
|
628
|
+
</li><li>
|
627
629
|
<p><code>layout</code> which takes the file name of a Rails layout and defaults to <code>layouts/application</code>. Use this to have your Rails application look differently depending on the component.</p>
|
628
630
|
</li><li>
|
629
631
|
<p><code>verb</code> which takes an HTTP verb as a symbol, one of: <code>%i[get head post put delete connect options trace patch]</code>. <code>verb</code> can be called up to once per verb. Inside each <code>verb</code> call, you can call (in the non-resourceful case):</p>
|
@@ -1518,6 +1520,39 @@ my_button = Compony.button(:index, :users, enabled: -> { |controller| control
|
|
1518
1520
|
cannot :set_password, User # This prohibits setting and changing passwords of any user
|
1519
1521
|
</code></pre>
|
1520
1522
|
|
1523
|
+
<h4 id="label-Dealing+with+multilingual+fields">Dealing with multilingual fields</h4>
|
1524
|
+
|
1525
|
+
<p>When using Gems such as <code>mobility</code>, Compony provides support for multilingual fields. For instance, assuming that a model has the attribute <code>label</code> translated in English and German, making <code>label</code> a virtual attribute reading either <code>label_en</code> and <code>label_de</code>, depending on the user’s language, Compony automatically generates a multilingual field if the following is used:</p>
|
1526
|
+
|
1527
|
+
<p>In the model:</p>
|
1528
|
+
|
1529
|
+
<pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'>Foo</span> <span class='op'><</span> <span class='const'>ApplicationRecord</span>
|
1530
|
+
<span class='comment'># No need to write:
|
1531
|
+
</span> <span class='id identifier rubyid_field'>field</span> <span class='symbol'>:label</span><span class='comma'>,</span> <span class='symbol'>:string</span><span class='comma'>,</span> <span class='label'>virtual:</span> <span class='kw'>true</span>
|
1532
|
+
<span class='const'>I18n</span><span class='period'>.</span><span class='id identifier rubyid_available_locales'>available_locales</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_locale'>locale</span><span class='op'>|</span>
|
1533
|
+
<span class='id identifier rubyid_field'>field</span> <span class='symbol'>:"label_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_locale'>locale</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:string</span>
|
1534
|
+
<span class='kw'>end</span>
|
1535
|
+
|
1536
|
+
<span class='comment'># Instead, write this, which is equivalent:
|
1537
|
+
</span> <span class='id identifier rubyid_field'>field</span> <span class='symbol'>:label</span><span class='comma'>,</span> <span class='symbol'>:string</span><span class='comma'>,</span> <span class='label'>multilang:</span> <span class='kw'>true</span>
|
1538
|
+
<span class='kw'>end</span>
|
1539
|
+
</code></pre>
|
1540
|
+
|
1541
|
+
<p>In the same mindset, you can simplify your form as follows to generate one input per language:</p>
|
1542
|
+
|
1543
|
+
<pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'><span class='object_link'><a href="Components.html" title="Components (module)">Components</a></span></span><span class='op'>::</span><span class='const'>Foos</span><span class='op'>::</span><span class='const'>Form</span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="Compony.html" title="Compony (module)">Compony</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Compony/Components.html" title="Compony::Components (module)">Components</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Compony/Components/Form.html" title="Compony::Components::Form (class)">Form</a></span></span>
|
1544
|
+
<span class='id identifier rubyid_setup'>setup</span> <span class='kw'>do</span>
|
1545
|
+
<span class='id identifier rubyid_form_fields'>form_fields</span> <span class='kw'>do</span>
|
1546
|
+
<span class='comment'># Since `field` only generates an input, you must loop over them and render them as you wish, e.g. with "concat":
|
1547
|
+
</span> <span class='id identifier rubyid_field'>field</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='label'>multilang:</span> <span class='kw'>true</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_inp'>inp</span><span class='op'>|</span> <span class='id identifier rubyid_concat'>concat</span> <span class='id identifier rubyid_inp'>inp</span> <span class='rbrace'>}</span>
|
1548
|
+
<span class='kw'>end</span>
|
1549
|
+
|
1550
|
+
<span class='comment'># Don't forget to mark `schema_field` as multilingual as well, which will accept label_en and label_de:
|
1551
|
+
</span> <span class='id identifier rubyid_schema_field'>schema_field</span> <span class='symbol'>:label</span><span class='comma'>,</span> <span class='label'>multilang:</span> <span class='kw'>true</span>
|
1552
|
+
<span class='kw'>end</span>
|
1553
|
+
<span class='kw'>end</span>
|
1554
|
+
</code></pre>
|
1555
|
+
|
1521
1556
|
<h3 id="label-New">New</h3>
|
1522
1557
|
|
1523
1558
|
<p>This component is the Compony equivalent to a typical Rails controller’s <code>new</code> and <code>create</code> actions.</p>
|
@@ -1695,7 +1730,7 @@ my_button = Compony.button(:index, :users, enabled: -> { |controller| control
|
|
1695
1730
|
</div></div>
|
1696
1731
|
|
1697
1732
|
<div id="footer">
|
1698
|
-
Generated on Fri
|
1733
|
+
Generated on Fri Feb 14 13:24:11 2025 by
|
1699
1734
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1700
1735
|
0.9.37 (ruby-3.3.5).
|
1701
1736
|
</div>
|
data/doc/index.html
CHANGED
@@ -624,6 +624,8 @@
|
|
624
624
|
</li><li>
|
625
625
|
<p><code>skip_authentication!</code> which disables authentication, in case you provided some. You need to implement <code>authorize</code> regardless.</p>
|
626
626
|
</li><li>
|
627
|
+
<p><code>skip_forgery_protection!</code> which disables CSRF protection for the controller action generated for this standalone configuration.</p>
|
628
|
+
</li><li>
|
627
629
|
<p><code>layout</code> which takes the file name of a Rails layout and defaults to <code>layouts/application</code>. Use this to have your Rails application look differently depending on the component.</p>
|
628
630
|
</li><li>
|
629
631
|
<p><code>verb</code> which takes an HTTP verb as a symbol, one of: <code>%i[get head post put delete connect options trace patch]</code>. <code>verb</code> can be called up to once per verb. Inside each <code>verb</code> call, you can call (in the non-resourceful case):</p>
|
@@ -1518,6 +1520,39 @@ my_button = Compony.button(:index, :users, enabled: -> { |controller| control
|
|
1518
1520
|
cannot :set_password, User # This prohibits setting and changing passwords of any user
|
1519
1521
|
</code></pre>
|
1520
1522
|
|
1523
|
+
<h4 id="label-Dealing+with+multilingual+fields">Dealing with multilingual fields</h4>
|
1524
|
+
|
1525
|
+
<p>When using Gems such as <code>mobility</code>, Compony provides support for multilingual fields. For instance, assuming that a model has the attribute <code>label</code> translated in English and German, making <code>label</code> a virtual attribute reading either <code>label_en</code> and <code>label_de</code>, depending on the user’s language, Compony automatically generates a multilingual field if the following is used:</p>
|
1526
|
+
|
1527
|
+
<p>In the model:</p>
|
1528
|
+
|
1529
|
+
<pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'>Foo</span> <span class='op'><</span> <span class='const'>ApplicationRecord</span>
|
1530
|
+
<span class='comment'># No need to write:
|
1531
|
+
</span> <span class='id identifier rubyid_field'>field</span> <span class='symbol'>:label</span><span class='comma'>,</span> <span class='symbol'>:string</span><span class='comma'>,</span> <span class='label'>virtual:</span> <span class='kw'>true</span>
|
1532
|
+
<span class='const'>I18n</span><span class='period'>.</span><span class='id identifier rubyid_available_locales'>available_locales</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_locale'>locale</span><span class='op'>|</span>
|
1533
|
+
<span class='id identifier rubyid_field'>field</span> <span class='symbol'>:"label_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_locale'>locale</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:string</span>
|
1534
|
+
<span class='kw'>end</span>
|
1535
|
+
|
1536
|
+
<span class='comment'># Instead, write this, which is equivalent:
|
1537
|
+
</span> <span class='id identifier rubyid_field'>field</span> <span class='symbol'>:label</span><span class='comma'>,</span> <span class='symbol'>:string</span><span class='comma'>,</span> <span class='label'>multilang:</span> <span class='kw'>true</span>
|
1538
|
+
<span class='kw'>end</span>
|
1539
|
+
</code></pre>
|
1540
|
+
|
1541
|
+
<p>In the same mindset, you can simplify your form as follows to generate one input per language:</p>
|
1542
|
+
|
1543
|
+
<pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'><span class='object_link'><a href="Components.html" title="Components (module)">Components</a></span></span><span class='op'>::</span><span class='const'>Foos</span><span class='op'>::</span><span class='const'>Form</span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="Compony.html" title="Compony (module)">Compony</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Compony/Components.html" title="Compony::Components (module)">Components</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Compony/Components/Form.html" title="Compony::Components::Form (class)">Form</a></span></span>
|
1544
|
+
<span class='id identifier rubyid_setup'>setup</span> <span class='kw'>do</span>
|
1545
|
+
<span class='id identifier rubyid_form_fields'>form_fields</span> <span class='kw'>do</span>
|
1546
|
+
<span class='comment'># Since `field` only generates an input, you must loop over them and render them as you wish, e.g. with "concat":
|
1547
|
+
</span> <span class='id identifier rubyid_field'>field</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='label'>multilang:</span> <span class='kw'>true</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_inp'>inp</span><span class='op'>|</span> <span class='id identifier rubyid_concat'>concat</span> <span class='id identifier rubyid_inp'>inp</span> <span class='rbrace'>}</span>
|
1548
|
+
<span class='kw'>end</span>
|
1549
|
+
|
1550
|
+
<span class='comment'># Don't forget to mark `schema_field` as multilingual as well, which will accept label_en and label_de:
|
1551
|
+
</span> <span class='id identifier rubyid_schema_field'>schema_field</span> <span class='symbol'>:label</span><span class='comma'>,</span> <span class='label'>multilang:</span> <span class='kw'>true</span>
|
1552
|
+
<span class='kw'>end</span>
|
1553
|
+
<span class='kw'>end</span>
|
1554
|
+
</code></pre>
|
1555
|
+
|
1521
1556
|
<h3 id="label-New">New</h3>
|
1522
1557
|
|
1523
1558
|
<p>This component is the Compony equivalent to a typical Rails controller’s <code>new</code> and <code>create</code> actions.</p>
|
@@ -1695,7 +1730,7 @@ my_button = Compony.button(:index, :users, enabled: -> { |controller| control
|
|
1695
1730
|
</div></div>
|
1696
1731
|
|
1697
1732
|
<div id="footer">
|
1698
|
-
Generated on Fri
|
1733
|
+
Generated on Fri Feb 14 13:24:10 2025 by
|
1699
1734
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1700
1735
|
0.9.37 (ruby-3.3.5).
|
1701
1736
|
</div>
|