compony 0.11.8 → 0.11.9
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/.yardopts +36 -1
- data/CHANGELOG.md +31 -0
- data/CLAUDE.md +85 -0
- data/Gemfile.lock +1 -1
- data/README.md +13 -3
- data/VERSION +1 -1
- data/compony.gemspec +3 -3
- data/doc/ComponentGenerator.html +1 -1
- data/doc/Components.html +1 -1
- data/doc/ComponentsGenerator.html +1 -1
- data/doc/Compony/Component.html +54 -54
- 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 +109 -70
- data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +64 -28
- data/doc/Compony/ComponentMixins/Default/Standalone.html +1 -1
- data/doc/Compony/ComponentMixins/Default.html +1 -1
- data/doc/Compony/ComponentMixins/Resourceful.html +213 -74
- data/doc/Compony/ComponentMixins.html +1 -1
- data/doc/Compony/Components/Buttons/CssButton.html +1 -1
- data/doc/Compony/Components/Buttons/Link.html +1 -1
- data/doc/Compony/Components/Buttons.html +1 -1
- data/doc/Compony/Components/Destroy.html +83 -29
- data/doc/Compony/Components/Edit.html +110 -38
- data/doc/Compony/Components/Form.html +551 -208
- data/doc/Compony/Components/Index.html +1 -1
- data/doc/Compony/Components/List.html +3 -3
- data/doc/Compony/Components/New.html +110 -38
- data/doc/Compony/Components/Show.html +1 -1
- data/doc/Compony/Components/WithForm.html +194 -47
- data/doc/Compony/Components.html +1 -1
- data/doc/Compony/ControllerMixin.html +1 -1
- data/doc/Compony/Engine.html +1 -1
- data/doc/Compony/Intent.html +2 -2
- data/doc/Compony/ManageIntentsDsl.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 +1 -1
- 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/VirtualModel.html +1 -1
- data/doc/Compony.html +1 -1
- data/doc/ComponyController.html +1 -1
- data/doc/_index.html +97 -1
- data/doc/file.CHANGELOG.html +758 -0
- data/doc/file.README.html +25 -4
- data/doc/file.basic_component.html +314 -0
- data/doc/file.cookbook.html +189 -0
- data/doc/file.destroy.html +105 -0
- data/doc/file.dsl_reference.html +672 -0
- data/doc/file.edit.html +109 -0
- data/doc/file.example.html +291 -0
- data/doc/file.example_advanced.html +257 -0
- data/doc/file.feasibility.html +115 -0
- data/doc/file.form.html +195 -0
- data/doc/file.generators.html +89 -0
- data/doc/file.glossary.html +217 -0
- data/doc/file.gotchas.html +222 -0
- data/doc/file.index.html +135 -0
- data/doc/file.inheritance.html +136 -0
- data/doc/file.installation.html +115 -0
- data/doc/file.integrations.html +218 -0
- data/doc/file.intents.html +265 -0
- data/doc/file.internal_datastructures.html +129 -0
- data/doc/file.list.html +253 -0
- data/doc/file.maintaining.html +127 -0
- data/doc/file.model_fields.html +137 -0
- data/doc/file.nesting.html +237 -0
- data/doc/file.new.html +109 -0
- data/doc/file.ownership.html +98 -0
- data/doc/file.patterns.html +669 -0
- data/doc/file.pre_built_components.html +99 -0
- data/doc/file.resourceful.html +181 -0
- data/doc/file.show.html +158 -0
- data/doc/file.standalone.html +233 -0
- data/doc/file.virtual_models.html +117 -0
- data/doc/file.with_form.html +157 -0
- data/doc/file_list.html +160 -0
- data/doc/guide/cookbook.md +41 -0
- data/doc/guide/dsl_reference.md +155 -0
- data/doc/guide/example_advanced.md +209 -0
- data/doc/guide/generators.md +1 -1
- data/doc/guide/glossary.md +42 -0
- data/doc/guide/gotchas.md +125 -0
- data/doc/guide/maintaining.md +64 -0
- data/doc/guide/patterns.md +681 -0
- data/doc/guide/pre_built_components/edit.md +1 -1
- data/doc/guide/pre_built_components/index.md +64 -1
- data/doc/guide/pre_built_components/list.md +111 -7
- data/doc/guide/pre_built_components/show.md +57 -2
- data/doc/guide/pre_built_components/with_form.md +56 -9
- data/doc/guide/pre_built_components.md +7 -2
- data/doc/guide/standalone.md +16 -1
- data/doc/index.html +25 -4
- data/doc/integrations.md +61 -0
- data/doc/llms.txt +62 -0
- data/doc/top-level-namespace.html +1 -1
- data/lib/compony/component.rb +8 -3
- data/lib/compony/component_mixins/default/standalone/standalone_dsl.rb +32 -15
- data/lib/compony/component_mixins/default/standalone/verb_dsl.rb +11 -3
- data/lib/compony/component_mixins/resourceful.rb +30 -16
- data/lib/compony/components/destroy.rb +21 -1
- data/lib/compony/components/edit.rb +25 -1
- data/lib/compony/components/form.rb +63 -21
- data/lib/compony/components/list.rb +1 -1
- data/lib/compony/components/new.rb +25 -1
- data/lib/compony/components/with_form.rb +20 -5
- data/lib/compony/intent.rb +1 -1
- metadata +43 -1
|
@@ -113,6 +113,37 @@
|
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
</div>
|
|
116
|
+
|
|
117
|
+
<h2>
|
|
118
|
+
Constant Summary
|
|
119
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
|
120
|
+
</h2>
|
|
121
|
+
|
|
122
|
+
<dl class="constants">
|
|
123
|
+
|
|
124
|
+
<dt id="DEFAULT_CONFIG-constant" class="">DEFAULT_CONFIG =
|
|
125
|
+
<div class="docstring">
|
|
126
|
+
<div class="discussion">
|
|
127
|
+
|
|
128
|
+
<p>Defaults injected only on the first <code>standalone</code> call. Kept out of subsequent calls so inherited values survive.</p>
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
<div class="tags">
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
</div>
|
|
137
|
+
</dt>
|
|
138
|
+
<dd><pre class="code"><span class='lbrace'>{</span>
|
|
139
|
+
<span class='label'>skip_authentication:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
|
140
|
+
<span class='label'>skip_forgery_protection:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
|
141
|
+
<span class='label'>layout:</span> <span class='kw'>true</span>
|
|
142
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
|
143
|
+
|
|
144
|
+
</dl>
|
|
145
|
+
|
|
146
|
+
|
|
116
147
|
|
|
117
148
|
|
|
118
149
|
|
|
@@ -156,7 +187,7 @@
|
|
|
156
187
|
<li class="protected ">
|
|
157
188
|
<span class="summary_signature">
|
|
158
189
|
|
|
159
|
-
<a href="#layout-instance_method" title="#layout (instance method)">#<strong>layout</strong>(layout) ⇒
|
|
190
|
+
<a href="#layout-instance_method" title="#layout (instance method)">#<strong>layout</strong>(layout) ⇒ void </a>
|
|
160
191
|
|
|
161
192
|
|
|
162
193
|
|
|
@@ -171,7 +202,7 @@
|
|
|
171
202
|
|
|
172
203
|
|
|
173
204
|
<span class="summary_desc"><div class='inline'>
|
|
174
|
-
<p>DSL
|
|
205
|
+
<p>DSL method.</p>
|
|
175
206
|
</div></span>
|
|
176
207
|
|
|
177
208
|
</li>
|
|
@@ -180,7 +211,7 @@
|
|
|
180
211
|
<li class="protected ">
|
|
181
212
|
<span class="summary_signature">
|
|
182
213
|
|
|
183
|
-
<a href="#skip_authentication!-instance_method" title="#skip_authentication! (instance method)">#<strong>skip_authentication!</strong> ⇒
|
|
214
|
+
<a href="#skip_authentication!-instance_method" title="#skip_authentication! (instance method)">#<strong>skip_authentication!</strong> ⇒ void </a>
|
|
184
215
|
|
|
185
216
|
|
|
186
217
|
|
|
@@ -195,7 +226,7 @@
|
|
|
195
226
|
|
|
196
227
|
|
|
197
228
|
<span class="summary_desc"><div class='inline'>
|
|
198
|
-
<p>DSL
|
|
229
|
+
<p>DSL method.</p>
|
|
199
230
|
</div></span>
|
|
200
231
|
|
|
201
232
|
</li>
|
|
@@ -204,7 +235,7 @@
|
|
|
204
235
|
<li class="protected ">
|
|
205
236
|
<span class="summary_signature">
|
|
206
237
|
|
|
207
|
-
<a href="#skip_forgery_protection!-instance_method" title="#skip_forgery_protection! (instance method)">#<strong>skip_forgery_protection!</strong> ⇒
|
|
238
|
+
<a href="#skip_forgery_protection!-instance_method" title="#skip_forgery_protection! (instance method)">#<strong>skip_forgery_protection!</strong> ⇒ void </a>
|
|
208
239
|
|
|
209
240
|
|
|
210
241
|
|
|
@@ -219,7 +250,7 @@
|
|
|
219
250
|
|
|
220
251
|
|
|
221
252
|
<span class="summary_desc"><div class='inline'>
|
|
222
|
-
<p>DSL
|
|
253
|
+
<p>DSL method.</p>
|
|
223
254
|
</div></span>
|
|
224
255
|
|
|
225
256
|
</li>
|
|
@@ -252,7 +283,7 @@
|
|
|
252
283
|
<li class="protected ">
|
|
253
284
|
<span class="summary_signature">
|
|
254
285
|
|
|
255
|
-
<a href="#verb-instance_method" title="#verb (instance method)">#<strong>verb</strong>(verb, **nargs) ⇒
|
|
286
|
+
<a href="#verb-instance_method" title="#verb (instance method)">#<strong>verb</strong>(verb, **nargs) ⇒ void </a>
|
|
256
287
|
|
|
257
288
|
|
|
258
289
|
|
|
@@ -267,7 +298,7 @@
|
|
|
267
298
|
|
|
268
299
|
|
|
269
300
|
<span class="summary_desc"><div class='inline'>
|
|
270
|
-
<p>DSL
|
|
301
|
+
<p>DSL method.</p>
|
|
271
302
|
</div></span>
|
|
272
303
|
|
|
273
304
|
</li>
|
|
@@ -319,7 +350,10 @@
|
|
|
319
350
|
19
|
|
320
351
|
20
|
|
321
352
|
21
|
|
322
|
-
22
|
|
353
|
+
22
|
|
354
|
+
23
|
|
355
|
+
24
|
|
356
|
+
25</pre>
|
|
323
357
|
</td>
|
|
324
358
|
<td>
|
|
325
359
|
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 9</span>
|
|
@@ -334,9 +368,12 @@
|
|
|
334
368
|
<span class='ivar'>@scope</span> <span class='op'>=</span> <span class='id identifier rubyid_scope'>scope</span>
|
|
335
369
|
<span class='ivar'>@scope_args</span> <span class='op'>=</span> <span class='id identifier rubyid_scope_args'>scope_args</span>
|
|
336
370
|
<span class='ivar'>@verbs</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
337
|
-
<span class='
|
|
338
|
-
|
|
339
|
-
|
|
371
|
+
<span class='comment'># These default to nil so that, on subsequent `standalone` calls (e.g. subclass overrides), they are stripped
|
|
372
|
+
</span> <span class='comment'># by `compact` and thus do NOT clobber values inherited via `deep_merge!`. The actual defaults are only injected
|
|
373
|
+
</span> <span class='comment'># when `provide_defaults` is true (i.e. the first `standalone` call). This mirrors VerbDsl#to_conf.
|
|
374
|
+
</span> <span class='ivar'>@skip_authentication</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
375
|
+
<span class='ivar'>@skip_forgery_protection</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
376
|
+
<span class='ivar'>@layout</span> <span class='op'>=</span> <span class='kw'>nil</span> <span class='comment'># can be overriden by false or a string
|
|
340
377
|
</span><span class='kw'>end</span></pre>
|
|
341
378
|
</td>
|
|
342
379
|
</tr>
|
|
@@ -353,7 +390,7 @@
|
|
|
353
390
|
<div class="method_details first">
|
|
354
391
|
<h3 class="signature first" id="layout-instance_method">
|
|
355
392
|
|
|
356
|
-
#<strong>layout</strong>(layout) ⇒ <tt>
|
|
393
|
+
#<strong>layout</strong>(layout) ⇒ <tt>void</tt> <span class="extras">(protected)</span>
|
|
357
394
|
|
|
358
395
|
|
|
359
396
|
|
|
@@ -361,8 +398,8 @@
|
|
|
361
398
|
|
|
362
399
|
</h3><div class="docstring">
|
|
363
400
|
<div class="discussion">
|
|
364
|
-
|
|
365
|
-
<p>DSL
|
|
401
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
402
|
+
<p>DSL method. Sets the Rails layout (under <code>app/views/layouts</code>) used to render this component. Defaults to Rails’ default (<code>layouts/application</code>) if never called.</p>
|
|
366
403
|
|
|
367
404
|
|
|
368
405
|
</div>
|
|
@@ -376,13 +413,13 @@
|
|
|
376
413
|
<span class='name'>layout</span>
|
|
377
414
|
|
|
378
415
|
|
|
379
|
-
<span class='type'>(<tt>String</tt>)</span>
|
|
416
|
+
<span class='type'>(<tt>String</tt>, <tt>Symbol</tt>)</span>
|
|
380
417
|
|
|
381
418
|
|
|
382
419
|
|
|
383
420
|
—
|
|
384
421
|
<div class='inline'>
|
|
385
|
-
<p>name
|
|
422
|
+
<p>Layout name, as passed to a Rails controller’s <code>render</code>.</p>
|
|
386
423
|
</div>
|
|
387
424
|
|
|
388
425
|
</li>
|
|
@@ -396,12 +433,12 @@
|
|
|
396
433
|
<pre class="lines">
|
|
397
434
|
|
|
398
435
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
436
|
+
97
|
|
437
|
+
98
|
|
438
|
+
99</pre>
|
|
402
439
|
</td>
|
|
403
440
|
<td>
|
|
404
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line
|
|
441
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 97</span>
|
|
405
442
|
|
|
406
443
|
<span class='kw'>def</span> <span class='id identifier rubyid_layout'>layout</span><span class='lparen'>(</span><span class='id identifier rubyid_layout'>layout</span><span class='rparen'>)</span>
|
|
407
444
|
<span class='ivar'>@layout</span> <span class='op'>=</span> <span class='id identifier rubyid_layout'>layout</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
|
@@ -414,7 +451,7 @@
|
|
|
414
451
|
<div class="method_details ">
|
|
415
452
|
<h3 class="signature " id="skip_authentication!-instance_method">
|
|
416
453
|
|
|
417
|
-
#<strong>skip_authentication!</strong> ⇒ <tt>
|
|
454
|
+
#<strong>skip_authentication!</strong> ⇒ <tt>void</tt> <span class="extras">(protected)</span>
|
|
418
455
|
|
|
419
456
|
|
|
420
457
|
|
|
@@ -422,8 +459,8 @@
|
|
|
422
459
|
|
|
423
460
|
</h3><div class="docstring">
|
|
424
461
|
<div class="discussion">
|
|
425
|
-
|
|
426
|
-
<p>DSL
|
|
462
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
463
|
+
<p>DSL method. Disables app authentication for this standalone (an <code>authorize</code> block is still mandatory).</p>
|
|
427
464
|
|
|
428
465
|
|
|
429
466
|
</div>
|
|
@@ -437,12 +474,12 @@
|
|
|
437
474
|
<pre class="lines">
|
|
438
475
|
|
|
439
476
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
477
|
+
81
|
|
478
|
+
82
|
|
479
|
+
83</pre>
|
|
443
480
|
</td>
|
|
444
481
|
<td>
|
|
445
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line
|
|
482
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 81</span>
|
|
446
483
|
|
|
447
484
|
<span class='kw'>def</span> <span class='id identifier rubyid_skip_authentication!'>skip_authentication!</span>
|
|
448
485
|
<span class='ivar'>@skip_authentication</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|
@@ -455,7 +492,7 @@
|
|
|
455
492
|
<div class="method_details ">
|
|
456
493
|
<h3 class="signature " id="skip_forgery_protection!-instance_method">
|
|
457
494
|
|
|
458
|
-
#<strong>skip_forgery_protection!</strong> ⇒ <tt>
|
|
495
|
+
#<strong>skip_forgery_protection!</strong> ⇒ <tt>void</tt> <span class="extras">(protected)</span>
|
|
459
496
|
|
|
460
497
|
|
|
461
498
|
|
|
@@ -463,8 +500,8 @@
|
|
|
463
500
|
|
|
464
501
|
</h3><div class="docstring">
|
|
465
502
|
<div class="discussion">
|
|
466
|
-
|
|
467
|
-
<p>DSL
|
|
503
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
504
|
+
<p>DSL method. Disables forgery protection (CSRF) for this standalone’s controller action.</p>
|
|
468
505
|
|
|
469
506
|
|
|
470
507
|
</div>
|
|
@@ -478,12 +515,12 @@
|
|
|
478
515
|
<pre class="lines">
|
|
479
516
|
|
|
480
517
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
518
|
+
88
|
|
519
|
+
89
|
|
520
|
+
90</pre>
|
|
484
521
|
</td>
|
|
485
522
|
<td>
|
|
486
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line
|
|
523
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 88</span>
|
|
487
524
|
|
|
488
525
|
<span class='kw'>def</span> <span class='id identifier rubyid_skip_forgery_protection!'>skip_forgery_protection!</span>
|
|
489
526
|
<span class='ivar'>@skip_forgery_protection</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|
@@ -519,31 +556,33 @@
|
|
|
519
556
|
<pre class="lines">
|
|
520
557
|
|
|
521
558
|
|
|
522
|
-
25
|
|
523
|
-
26
|
|
524
|
-
27
|
|
525
|
-
28
|
|
526
|
-
29
|
|
527
|
-
30
|
|
528
|
-
31
|
|
529
|
-
32
|
|
530
|
-
33
|
|
531
|
-
34
|
|
532
559
|
35
|
|
533
560
|
36
|
|
534
561
|
37
|
|
535
562
|
38
|
|
536
563
|
39
|
|
537
564
|
40
|
|
538
|
-
41
|
|
565
|
+
41
|
|
566
|
+
42
|
|
567
|
+
43
|
|
568
|
+
44
|
|
569
|
+
45
|
|
570
|
+
46
|
|
571
|
+
47
|
|
572
|
+
48
|
|
573
|
+
49
|
|
574
|
+
50
|
|
575
|
+
51
|
|
576
|
+
52</pre>
|
|
539
577
|
</td>
|
|
540
578
|
<td>
|
|
541
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line
|
|
579
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 35</span>
|
|
542
580
|
|
|
543
581
|
<span class='kw'>def</span> <span class='id identifier rubyid_to_conf'>to_conf</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
544
582
|
<span class='id identifier rubyid_evaluate'>evaluate</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
545
583
|
<span class='ivar'>@component</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_binding'>binding</span><span class='period'>.</span><span class='id identifier rubyid_eval'>eval</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>self</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'># Fetches the component holding this DSL call (via the block)
|
|
546
|
-
</span> <span class='
|
|
584
|
+
</span> <span class='id identifier rubyid_base_config'>base_config</span> <span class='op'>=</span> <span class='ivar'>@provide_defaults</span> <span class='op'>?</span> <span class='const'><span class='object_link'><a href="#DEFAULT_CONFIG-constant" title="Compony::ComponentMixins::Default::Standalone::StandaloneDsl::DEFAULT_CONFIG (constant)">DEFAULT_CONFIG</a></span></span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span> <span class='op'>:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
585
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_base_config'>base_config</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='lbrace'>{</span>
|
|
547
586
|
<span class='label'>name:</span> <span class='ivar'>@name</span><span class='comma'>,</span>
|
|
548
587
|
<span class='label'>path:</span> <span class='ivar'>@path</span><span class='comma'>,</span>
|
|
549
588
|
<span class='label'>constraints:</span> <span class='ivar'>@constraints</span><span class='comma'>,</span>
|
|
@@ -555,7 +594,7 @@
|
|
|
555
594
|
<span class='label'>skip_authentication:</span> <span class='ivar'>@skip_authentication</span><span class='comma'>,</span>
|
|
556
595
|
<span class='label'>skip_forgery_protection:</span> <span class='ivar'>@skip_forgery_protection</span><span class='comma'>,</span>
|
|
557
596
|
<span class='label'>layout:</span> <span class='ivar'>@layout</span>
|
|
558
|
-
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span>
|
|
597
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='rparen'>)</span>
|
|
559
598
|
<span class='kw'>end</span></pre>
|
|
560
599
|
</td>
|
|
561
600
|
</tr>
|
|
@@ -565,7 +604,7 @@
|
|
|
565
604
|
<div class="method_details ">
|
|
566
605
|
<h3 class="signature " id="verb-instance_method">
|
|
567
606
|
|
|
568
|
-
#<strong>verb</strong>(verb, **nargs) ⇒ <tt>
|
|
607
|
+
#<strong>verb</strong>(verb, **nargs) ⇒ <tt>void</tt> <span class="extras">(protected)</span>
|
|
569
608
|
|
|
570
609
|
|
|
571
610
|
|
|
@@ -573,8 +612,8 @@
|
|
|
573
612
|
|
|
574
613
|
</h3><div class="docstring">
|
|
575
614
|
<div class="discussion">
|
|
576
|
-
|
|
577
|
-
<p>DSL
|
|
615
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
616
|
+
<p>DSL method. Defines the config for one HTTP verb. The block runs within the verb DSL; positional and named arguments are forwarded to it. Call at most once per verb per standalone.</p>
|
|
578
617
|
|
|
579
618
|
|
|
580
619
|
</div>
|
|
@@ -594,7 +633,7 @@
|
|
|
594
633
|
|
|
595
634
|
—
|
|
596
635
|
<div class='inline'>
|
|
597
|
-
<p>The HTTP verb
|
|
636
|
+
<p>The HTTP verb (one of <code>:get :head :post :put :delete :connect :options :trace :patch</code>).</p>
|
|
598
637
|
</div>
|
|
599
638
|
|
|
600
639
|
</li>
|
|
@@ -615,24 +654,24 @@
|
|
|
615
654
|
<pre class="lines">
|
|
616
655
|
|
|
617
656
|
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
657
|
+
62
|
|
658
|
+
63
|
|
659
|
+
64
|
|
660
|
+
65
|
|
661
|
+
66
|
|
662
|
+
67
|
|
663
|
+
68
|
|
664
|
+
69
|
|
665
|
+
70
|
|
666
|
+
71
|
|
667
|
+
72
|
|
668
|
+
73
|
|
669
|
+
74
|
|
670
|
+
75
|
|
671
|
+
76</pre>
|
|
633
672
|
</td>
|
|
634
673
|
<td>
|
|
635
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line
|
|
674
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 62</span>
|
|
636
675
|
|
|
637
676
|
<span class='kw'>def</span> <span class='id identifier rubyid_verb'>verb</span><span class='lparen'>(</span><span class='id identifier rubyid_verb'>verb</span><span class='comma'>,</span> <span class='op'>*</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_nargs'>nargs</span><span class='comma'>,</span> <span class='op'>&</span><span class='rparen'>)</span>
|
|
638
677
|
<span class='id identifier rubyid_verb'>verb</span> <span class='op'>=</span> <span class='id identifier rubyid_verb'>verb</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
|
@@ -659,7 +698,7 @@
|
|
|
659
698
|
</div>
|
|
660
699
|
|
|
661
700
|
<div id="footer">
|
|
662
|
-
Generated on
|
|
701
|
+
Generated on Mon May 18 13:55:36 2026 by
|
|
663
702
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
664
703
|
0.9.34 (ruby-3.3.5).
|
|
665
704
|
</div>
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
<li class="protected ">
|
|
169
169
|
<span class="summary_signature">
|
|
170
170
|
|
|
171
|
-
<a href="#authorize-instance_method" title="#authorize (instance method)">#<strong>authorize</strong>
|
|
171
|
+
<a href="#authorize-instance_method" title="#authorize (instance method)">#<strong>authorize</strong> { ... } ⇒ void </a>
|
|
172
172
|
|
|
173
173
|
|
|
174
174
|
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
|
|
184
184
|
|
|
185
185
|
<span class="summary_desc"><div class='inline'>
|
|
186
|
-
<p>DSL
|
|
186
|
+
<p>DSL Mandatory.</p>
|
|
187
187
|
</div></span>
|
|
188
188
|
|
|
189
189
|
</li>
|
|
@@ -242,7 +242,7 @@
|
|
|
242
242
|
<li class="protected ">
|
|
243
243
|
<span class="summary_signature">
|
|
244
244
|
|
|
245
|
-
<a href="#respond-instance_method" title="#respond (instance method)">#<strong>respond</strong>(format = nil
|
|
245
|
+
<a href="#respond-instance_method" title="#respond (instance method)">#<strong>respond</strong>(format = nil) { ... } ⇒ void </a>
|
|
246
246
|
|
|
247
247
|
|
|
248
248
|
|
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
|
|
258
258
|
|
|
259
259
|
<span class="summary_desc"><div class='inline'>
|
|
260
|
-
<p>DSL
|
|
260
|
+
<p>DSL Last step in the lifecycle.</p>
|
|
261
261
|
</div></span>
|
|
262
262
|
|
|
263
263
|
</li>
|
|
@@ -361,7 +361,7 @@
|
|
|
361
361
|
<div class="method_details first">
|
|
362
362
|
<h3 class="signature first" id="authorize-instance_method">
|
|
363
363
|
|
|
364
|
-
#<strong>authorize</strong>
|
|
364
|
+
#<strong>authorize</strong> { ... } ⇒ <tt>void</tt> <span class="extras">(protected)</span>
|
|
365
365
|
|
|
366
366
|
|
|
367
367
|
|
|
@@ -369,14 +369,32 @@
|
|
|
369
369
|
|
|
370
370
|
</h3><div class="docstring">
|
|
371
371
|
<div class="discussion">
|
|
372
|
-
|
|
373
|
-
<p>DSL
|
|
372
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
373
|
+
<p>DSL Mandatory. The block must return truthy iff <code>current_ability</code> may access the component over this verb; a falsy result raises <code>CanCan::AccessDenied</code>.</p>
|
|
374
374
|
|
|
375
375
|
|
|
376
376
|
</div>
|
|
377
377
|
</div>
|
|
378
378
|
<div class="tags">
|
|
379
379
|
|
|
380
|
+
<p class="tag_title">Yields:</p>
|
|
381
|
+
<ul class="yield">
|
|
382
|
+
|
|
383
|
+
<li>
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
<span class='type'></span>
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
<div class='inline'>
|
|
392
|
+
<p>Runs in the component’s request context; returns truthy to grant access.</p>
|
|
393
|
+
</div>
|
|
394
|
+
|
|
395
|
+
</li>
|
|
396
|
+
|
|
397
|
+
</ul>
|
|
380
398
|
|
|
381
399
|
</div><table class="source_code">
|
|
382
400
|
<tr>
|
|
@@ -384,12 +402,12 @@
|
|
|
384
402
|
<pre class="lines">
|
|
385
403
|
|
|
386
404
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
405
|
+
43
|
|
406
|
+
44
|
|
407
|
+
45</pre>
|
|
390
408
|
</td>
|
|
391
409
|
<td>
|
|
392
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/verb_dsl.rb', line
|
|
410
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/verb_dsl.rb', line 43</span>
|
|
393
411
|
|
|
394
412
|
<span class='kw'>def</span> <span class='id identifier rubyid_authorize'>authorize</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
395
413
|
<span class='ivar'>@authorize_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
@@ -425,15 +443,15 @@
|
|
|
425
443
|
<pre class="lines">
|
|
426
444
|
|
|
427
445
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
446
|
+
59
|
|
447
|
+
60
|
|
448
|
+
61
|
|
449
|
+
62
|
|
450
|
+
63
|
|
451
|
+
64</pre>
|
|
434
452
|
</td>
|
|
435
453
|
<td>
|
|
436
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/verb_dsl.rb', line
|
|
454
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/verb_dsl.rb', line 59</span>
|
|
437
455
|
|
|
438
456
|
<span class='kw'>def</span> <span class='id identifier rubyid_default_config'>default_config</span>
|
|
439
457
|
<span class='kw'>return</span> <span class='lbrace'>{</span>
|
|
@@ -449,7 +467,7 @@
|
|
|
449
467
|
<div class="method_details ">
|
|
450
468
|
<h3 class="signature " id="respond-instance_method">
|
|
451
469
|
|
|
452
|
-
#<strong>respond</strong>(format = nil
|
|
470
|
+
#<strong>respond</strong>(format = nil) { ... } ⇒ <tt>void</tt> <span class="extras">(protected)</span>
|
|
453
471
|
|
|
454
472
|
|
|
455
473
|
|
|
@@ -457,8 +475,8 @@
|
|
|
457
475
|
|
|
458
476
|
</h3><div class="docstring">
|
|
459
477
|
<div class="discussion">
|
|
460
|
-
|
|
461
|
-
<p>DSL
|
|
478
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
479
|
+
<p>DSL Last step in the lifecycle. May redirect or render. If omitted, the default is <code>render_standalone</code>. NOTE: overriding <code>respond</code> replaces the default, which is where <code>authorize</code> is evaluated - re-check authorization yourself.</p>
|
|
462
480
|
|
|
463
481
|
|
|
464
482
|
</div>
|
|
@@ -472,7 +490,7 @@
|
|
|
472
490
|
<span class='name'>format</span>
|
|
473
491
|
|
|
474
492
|
|
|
475
|
-
<span class='type'>(<tt>String</tt>, <tt>Symbol</tt>)</span>
|
|
493
|
+
<span class='type'>(<tt>String</tt>, <tt>Symbol</tt>, <tt>nil</tt>)</span>
|
|
476
494
|
|
|
477
495
|
|
|
478
496
|
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
@@ -480,13 +498,31 @@
|
|
|
480
498
|
|
|
481
499
|
—
|
|
482
500
|
<div class='inline'>
|
|
483
|
-
<p>Format this block
|
|
501
|
+
<p>Format this block responds to; <code>nil</code> means “all other formats”.</p>
|
|
484
502
|
</div>
|
|
485
503
|
|
|
486
504
|
</li>
|
|
487
505
|
|
|
488
506
|
</ul>
|
|
489
507
|
|
|
508
|
+
<p class="tag_title">Yields:</p>
|
|
509
|
+
<ul class="yield">
|
|
510
|
+
|
|
511
|
+
<li>
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
<span class='type'></span>
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
<div class='inline'>
|
|
520
|
+
<p>Runs in the component’s request context; renders or redirects.</p>
|
|
521
|
+
</div>
|
|
522
|
+
|
|
523
|
+
</li>
|
|
524
|
+
|
|
525
|
+
</ul>
|
|
490
526
|
|
|
491
527
|
</div><table class="source_code">
|
|
492
528
|
<tr>
|
|
@@ -494,12 +530,12 @@
|
|
|
494
530
|
<pre class="lines">
|
|
495
531
|
|
|
496
532
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
533
|
+
54
|
|
534
|
+
55
|
|
535
|
+
56</pre>
|
|
500
536
|
</td>
|
|
501
537
|
<td>
|
|
502
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/verb_dsl.rb', line
|
|
538
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/verb_dsl.rb', line 54</span>
|
|
503
539
|
|
|
504
540
|
<span class='kw'>def</span> <span class='id identifier rubyid_respond'>respond</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
505
541
|
<span class='ivar'>@respond_blocks</span><span class='lbracket'>[</span><span class='id identifier rubyid_format'>format</span><span class='op'>&.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
@@ -567,7 +603,7 @@
|
|
|
567
603
|
</div>
|
|
568
604
|
|
|
569
605
|
<div id="footer">
|
|
570
|
-
Generated on
|
|
606
|
+
Generated on Mon May 18 13:55:36 2026 by
|
|
571
607
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
572
608
|
0.9.34 (ruby-3.3.5).
|
|
573
609
|
</div>
|
|
@@ -868,7 +868,7 @@
|
|
|
868
868
|
</div>
|
|
869
869
|
|
|
870
870
|
<div id="footer">
|
|
871
|
-
Generated on
|
|
871
|
+
Generated on Mon May 18 13:55:35 2026 by
|
|
872
872
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
873
873
|
0.9.34 (ruby-3.3.5).
|
|
874
874
|
</div>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
118
|
<div id="footer">
|
|
119
|
-
Generated on
|
|
119
|
+
Generated on Mon May 18 13:55:35 2026 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>
|