compony 0.5.3 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/CHANGELOG.md +11 -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 +29 -29
- 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 +42 -7
- data/doc/index.html +42 -7
- 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 +24 -14
- 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
|
455
|
+
Generated on Mon Apr 7 13:00:53 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
|
596
|
+
Generated on Mon Apr 7 13:00:53 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
|
119
|
+
Generated on Mon Apr 7 13:00:52 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
|
129
|
+
Generated on Mon Apr 7 13:00:52 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
|
126
|
+
Generated on Mon Apr 7 13:00:52 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
|
446
|
+
Generated on Mon Apr 7 13:00:53 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
|
380
|
+
Generated on Mon Apr 7 13:00:53 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
|
606
|
+
Generated on Mon Apr 7 13:00:53 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
|
298
|
+
Generated on Mon Apr 7 13:00:53 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
|
1059
|
+
Generated on Mon Apr 7 13:00:53 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
|
225
|
+
Generated on Mon Apr 7 13:00:53 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
|
292
|
+
Generated on Mon Apr 7 13:00:53 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
|
225
|
+
Generated on Mon Apr 7 13:00:53 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
|
225
|
+
Generated on Mon Apr 7 13:00:53 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
|
225
|
+
Generated on Mon Apr 7 13:00:53 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
|
147
|
+
Generated on Mon Apr 7 13:00:53 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
|
233
|
+
Generated on Mon Apr 7 13:00:53 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
|
147
|
+
Generated on Mon Apr 7 13:00:53 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
|
147
|
+
Generated on Mon Apr 7 13:00:53 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
|
225
|
+
Generated on Mon Apr 7 13:00:53 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
|
294
|
+
Generated on Mon Apr 7 13:00:53 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
|
225
|
+
Generated on Mon Apr 7 13:00:53 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
|
147
|
+
Generated on Mon Apr 7 13:00:53 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
|
147
|
+
Generated on Mon Apr 7 13:00:53 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
|
147
|
+
Generated on Mon Apr 7 13:00:53 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
|
233
|
+
Generated on Mon Apr 7 13:00:53 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
|
119
|
+
Generated on Mon Apr 7 13:00:52 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
|
+
113
|
268
|
+
114
|
269
|
+
115
|
270
|
+
116
|
271
|
+
117</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 113</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,26 +360,26 @@
|
|
360
360
|
<pre class="lines">
|
361
361
|
|
362
362
|
|
363
|
-
82
|
364
|
-
83
|
365
|
-
84
|
366
|
-
85
|
367
|
-
86
|
368
|
-
87
|
369
|
-
88
|
370
|
-
89
|
371
|
-
90
|
372
|
-
91
|
373
363
|
92
|
374
364
|
93
|
375
365
|
94
|
376
366
|
95
|
377
367
|
96
|
378
368
|
97
|
379
|
-
98
|
369
|
+
98
|
370
|
+
99
|
371
|
+
100
|
372
|
+
101
|
373
|
+
102
|
374
|
+
103
|
375
|
+
104
|
376
|
+
105
|
377
|
+
106
|
378
|
+
107
|
379
|
+
108</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 92</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
|
+
130
|
433
|
+
131
|
434
|
+
132</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 130</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
|
+
123
|
494
|
+
124
|
495
|
+
125
|
496
|
+
126
|
497
|
+
127</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 123</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
|
517
|
+
Generated on Mon Apr 7 13:00:52 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
|
293
|
+
Generated on Mon Apr 7 13:00:53 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
|
934
|
+
Generated on Mon Apr 7 13:00:53 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
|
132
|
+
Generated on Mon Apr 7 13:00:52 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
|
454
|
+
Generated on Mon Apr 7 13:00:52 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
|
2209
|
+
Generated on Mon Apr 7 13:00:52 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
|
117
|
+
Generated on Mon Apr 7 13:00:53 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
|
569
|
+
Generated on Mon Apr 7 13:00:50 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
@@ -195,7 +195,7 @@
|
|
195
195
|
|
196
196
|
<p>Here is what our Show component looks like when we have a layout with the bare minimum and no styling at all:</p>
|
197
197
|
|
198
|
-
<p><img src="doc/imgs/intro-example-show.png"
|
198
|
+
<p><img src="doc/imgs/intro-example-show.png" alt="Screenshot"> of our component with an absolutely minimal layout</p>
|
199
199
|
|
200
200
|
<p>It is important to note that actions, buttons, navigation, notifications etc. are handled by the application layout. In this and the subsequent screenshots, we explicitely use minimalism, as it makes the generated HTML clearer.</p>
|
201
201
|
|
@@ -209,7 +209,7 @@
|
|
209
209
|
|
210
210
|
<p>Note that this component is fully functional. All is handled by the class it inherits from:</p>
|
211
211
|
|
212
|
-
<p><img src="doc/imgs/intro-example-destroy.png"
|
212
|
+
<p><img src="doc/imgs/intro-example-destroy.png" alt="Screenshot"> of the destroy component</p>
|
213
213
|
|
214
214
|
<h3 id="label-The+New+component+and+the+Form+component">The New component and the Form component</h3>
|
215
215
|
|
@@ -243,7 +243,7 @@
|
|
243
243
|
|
244
244
|
<p>This is enough to render a fully functional form that creates new users:</p>
|
245
245
|
|
246
|
-
<p><img src="doc/imgs/intro-example-new.png"
|
246
|
+
<p><img src="doc/imgs/intro-example-new.png" alt="New"> form</p>
|
247
247
|
|
248
248
|
<h3 id="label-The+Edit+component">The Edit component</h3>
|
249
249
|
|
@@ -255,7 +255,7 @@
|
|
255
255
|
|
256
256
|
<p>It then looks like this:</p>
|
257
257
|
|
258
|
-
<p><img src="doc/imgs/intro-example-edit.png"
|
258
|
+
<p><img src="doc/imgs/intro-example-edit.png" alt="Edit"> form</p>
|
259
259
|
|
260
260
|
<h3 id="label-The+Index+component">The Index component</h3>
|
261
261
|
|
@@ -307,7 +307,7 @@
|
|
307
307
|
|
308
308
|
<p>The result looks like this:</p>
|
309
309
|
|
310
|
-
<p><img src="doc/imgs/intro-example-index.png"
|
310
|
+
<p><img src="doc/imgs/intro-example-index.png" alt="Index"> component</p>
|
311
311
|
|
312
312
|
<p>Note how the admin’s delete button is disabled due to the feasibility framework. Pointing the mouse at it causes a tooltip saying: “Cannot destroy admins.”, as specified in the model’s prevention.</p>
|
313
313
|
|
@@ -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>
|
@@ -1009,7 +1011,7 @@ The number 8 has the binary form 1000. Enter a number and press ENTER: [8]
|
|
1009
1011
|
<p><code>respond</code> typically shows a flash and redirects to another component.</p>
|
1010
1012
|
</li></ul>
|
1011
1013
|
|
1012
|
-
<p><img src="doc/resourceful_lifecycle.png"
|
1014
|
+
<p><img src="doc/resourceful_lifecycle.png" alt="Graph"> of the complete resourceful lifecycle</p>
|
1013
1015
|
|
1014
1016
|
<h3 id="label-Nesting+resourceful+components">Nesting resourceful components</h3>
|
1015
1017
|
|
@@ -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
|
1733
|
+
Generated on Mon Apr 7 13:00:52 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>
|