compony 0.7.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +10 -14
  5. data/VERSION +1 -1
  6. data/compony.gemspec +4 -4
  7. data/doc/ComponentGenerator.html +1 -1
  8. data/doc/Components.html +1 -1
  9. data/doc/ComponentsGenerator.html +1 -1
  10. data/doc/Compony/Component.html +193 -457
  11. data/doc/Compony/ComponentMixins/Default/Labelling.html +1 -1
  12. data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +1 -1
  13. data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +3 -3
  14. data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +1 -1
  15. data/doc/Compony/ComponentMixins/Default/Standalone.html +187 -1
  16. data/doc/Compony/ComponentMixins/Default.html +1 -1
  17. data/doc/Compony/ComponentMixins/Resourceful.html +2 -2
  18. data/doc/Compony/ComponentMixins.html +1 -1
  19. data/doc/Compony/Components/Button.html +2 -2
  20. data/doc/Compony/Components/Buttons/CssButton.html +282 -0
  21. data/doc/Compony/Components/Buttons/Link.html +252 -0
  22. data/doc/Compony/Components/Buttons.html +126 -0
  23. data/doc/Compony/Components/Destroy.html +11 -11
  24. data/doc/Compony/Components/Edit.html +14 -14
  25. data/doc/Compony/Components/Form.html +100 -100
  26. data/doc/Compony/Components/Index.html +2 -2
  27. data/doc/Compony/Components/List.html +3 -3
  28. data/doc/Compony/Components/New.html +2 -2
  29. data/doc/Compony/Components/Show.html +24 -24
  30. data/doc/Compony/Components/WithForm.html +3 -3
  31. data/doc/Compony/Components.html +5 -3
  32. data/doc/Compony/ControllerMixin.html +2 -2
  33. data/doc/Compony/Engine.html +1 -1
  34. data/doc/Compony/ExposedIntentsDsl.html +403 -0
  35. data/doc/Compony/Intent.html +1503 -0
  36. data/doc/Compony/MethodAccessibleHash.html +1 -1
  37. data/doc/Compony/ModelFields/Anchormodel.html +1 -1
  38. data/doc/Compony/ModelFields/Association.html +2 -2
  39. data/doc/Compony/ModelFields/Attachment.html +1 -1
  40. data/doc/Compony/ModelFields/Base.html +1 -1
  41. data/doc/Compony/ModelFields/Boolean.html +1 -1
  42. data/doc/Compony/ModelFields/Color.html +1 -1
  43. data/doc/Compony/ModelFields/Currency.html +1 -1
  44. data/doc/Compony/ModelFields/Date.html +1 -1
  45. data/doc/Compony/ModelFields/Datetime.html +1 -1
  46. data/doc/Compony/ModelFields/Decimal.html +1 -1
  47. data/doc/Compony/ModelFields/Email.html +1 -1
  48. data/doc/Compony/ModelFields/Float.html +1 -1
  49. data/doc/Compony/ModelFields/Integer.html +1 -1
  50. data/doc/Compony/ModelFields/Percentage.html +1 -1
  51. data/doc/Compony/ModelFields/Phone.html +1 -1
  52. data/doc/Compony/ModelFields/RichText.html +1 -1
  53. data/doc/Compony/ModelFields/String.html +1 -1
  54. data/doc/Compony/ModelFields/Text.html +1 -1
  55. data/doc/Compony/ModelFields/Time.html +1 -1
  56. data/doc/Compony/ModelFields/Url.html +1 -1
  57. data/doc/Compony/ModelFields.html +1 -1
  58. data/doc/Compony/ModelMixin.html +1 -1
  59. data/doc/Compony/NaturalOrdering.html +1 -1
  60. data/doc/Compony/RequestContext.html +177 -14
  61. data/doc/Compony/Version.html +1 -1
  62. data/doc/Compony/ViewHelpers.html +15 -272
  63. data/doc/Compony/VirtualModel.html +1 -1
  64. data/doc/Compony.html +303 -837
  65. data/doc/ComponyController.html +1 -1
  66. data/doc/_index.html +30 -2
  67. data/doc/class_list.html +1 -1
  68. data/doc/file.README.html +11 -18
  69. data/doc/guide/basic_component.md +12 -8
  70. data/doc/guide/example.md +17 -17
  71. data/doc/guide/feasibility.md +4 -2
  72. data/doc/guide/generators.md +4 -2
  73. data/doc/guide/inheritance.md +4 -2
  74. data/doc/guide/installation.md +4 -2
  75. data/doc/guide/intents.md +167 -0
  76. data/doc/guide/internal_datastructures.md +4 -2
  77. data/doc/guide/model_fields.md +4 -2
  78. data/doc/guide/nesting.md +5 -3
  79. data/doc/guide/ownership.md +5 -3
  80. data/doc/guide/pre_built_components/destroy.md +3 -3
  81. data/doc/guide/pre_built_components/edit.md +1 -1
  82. data/doc/guide/pre_built_components/form.md +1 -1
  83. data/doc/guide/pre_built_components/index.md +1 -1
  84. data/doc/guide/pre_built_components/list.md +1 -1
  85. data/doc/guide/pre_built_components/new.md +2 -2
  86. data/doc/guide/pre_built_components/show.md +1 -1
  87. data/doc/guide/pre_built_components/with_form.md +1 -1
  88. data/doc/guide/pre_built_components.md +4 -3
  89. data/doc/guide/resourceful.md +5 -3
  90. data/doc/guide/standalone.md +10 -2
  91. data/doc/guide/virtual_models.md +4 -2
  92. data/doc/index.html +11 -18
  93. data/doc/method_list.html +273 -161
  94. data/doc/top-level-namespace.html +1 -1
  95. data/lib/compony/component.rb +19 -48
  96. data/lib/compony/component_mixins/default/standalone/standalone_dsl.rb +2 -2
  97. data/lib/compony/component_mixins/default/standalone.rb +16 -0
  98. data/lib/compony/component_mixins/resourceful.rb +1 -1
  99. data/lib/compony/components/buttons/css_button.rb +32 -0
  100. data/lib/compony/components/buttons/link.rb +31 -0
  101. data/lib/compony/components/destroy.rb +9 -8
  102. data/lib/compony/components/edit.rb +5 -4
  103. data/lib/compony/components/form.rb +7 -1
  104. data/lib/compony/components/index.rb +2 -2
  105. data/lib/compony/components/list.rb +4 -4
  106. data/lib/compony/components/new.rb +1 -1
  107. data/lib/compony/components/show.rb +8 -11
  108. data/lib/compony/components/with_form.rb +1 -1
  109. data/lib/compony/exposed_intents_dsl.rb +29 -0
  110. data/lib/compony/intent.rb +145 -0
  111. data/lib/compony/model_fields/association.rb +1 -1
  112. data/lib/compony/request_context.rb +21 -0
  113. data/lib/compony/view_helpers.rb +5 -48
  114. data/lib/compony.rb +63 -149
  115. metadata +12 -6
  116. data/doc/guide/helpers.md +0 -156
  117. data/doc/guide/pre_built_components/button.md +0 -8
  118. data/doc/guide/root_actions.md +0 -67
  119. data/lib/compony/components/button.rb +0 -61
@@ -443,7 +443,7 @@ instance_of_a_hash.roo --> nil
443
443
  </div>
444
444
 
445
445
  <div id="footer">
446
- Generated on Thu Nov 20 12:44:24 2025 by
446
+ Generated on Thu Nov 27 16:02:23 2025 by
447
447
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
448
448
  0.9.34 (ruby-3.3.5).
449
449
  </div>
@@ -509,7 +509,7 @@
509
509
  </div>
510
510
 
511
511
  <div id="footer">
512
- Generated on Thu Nov 20 12:44:25 2025 by
512
+ Generated on Thu Nov 27 16:02:23 2025 by
513
513
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
514
514
  0.9.34 (ruby-3.3.5).
515
515
  </div>
@@ -584,7 +584,7 @@
584
584
  <span class='kw'>return</span> <span class='id identifier rubyid_transform_and_join'>transform_and_join</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='ivar'>@name</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='label'>controller:</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_el'>el</span><span class='op'>|</span>
585
585
  <span class='kw'>next</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='id identifier rubyid_el'>el</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
586
586
  <span class='kw'>if</span> <span class='const'><span class='object_link'><a href="../../Compony.html" title="Compony (module)">Compony</a></span></span><span class='period'>.</span><span class='id identifier rubyid_comp_class_for'><span class='object_link'><a href="../../Compony.html#comp_class_for-class_method" title="Compony.comp_class_for (method)">comp_class_for</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_link_to_component'>link_to_component</span><span class='comma'>,</span> <span class='id identifier rubyid_el'>el</span><span class='rparen'>)</span>
587
- <span class='kw'>next</span> <span class='id identifier rubyid_controller'>controller</span><span class='period'>.</span><span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_compony_link'>compony_link</span><span class='lparen'>(</span><span class='id identifier rubyid_link_to_component'>link_to_component</span><span class='comma'>,</span> <span class='id identifier rubyid_el'>el</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_link_opts'>link_opts</span><span class='rparen'>)</span>
587
+ <span class='kw'>next</span> <span class='id identifier rubyid_controller'>controller</span><span class='period'>.</span><span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_render_intent'>render_intent</span><span class='lparen'>(</span><span class='id identifier rubyid_link_to_component'>link_to_component</span><span class='comma'>,</span> <span class='id identifier rubyid_el'>el</span><span class='comma'>,</span> <span class='op'>**</span><span class='lbrace'>{</span> <span class='label'>button:</span> <span class='lbrace'>{</span> <span class='label'>style:</span> <span class='symbol'>:link</span> <span class='rbrace'>}</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_deep_merge'>deep_merge</span><span class='lparen'>(</span><span class='id identifier rubyid_link_opts'>link_opts</span><span class='rparen'>)</span><span class='rparen'>)</span>
588
588
  <span class='kw'>else</span>
589
589
  <span class='kw'>next</span> <span class='id identifier rubyid_el'>el</span><span class='period'>.</span><span class='id identifier rubyid_label'>label</span>
590
590
  <span class='kw'>end</span>
@@ -603,7 +603,7 @@
603
603
  </div>
604
604
 
605
605
  <div id="footer">
606
- Generated on Thu Nov 20 12:44:25 2025 by
606
+ Generated on Thu Nov 27 16:02:23 2025 by
607
607
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
608
608
  0.9.34 (ruby-3.3.5).
609
609
  </div>
@@ -489,7 +489,7 @@
489
489
  </div>
490
490
 
491
491
  <div id="footer">
492
- Generated on Thu Nov 20 12:44:25 2025 by
492
+ Generated on Thu Nov 27 16:02:23 2025 by
493
493
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
494
494
  0.9.34 (ruby-3.3.5).
495
495
  </div>
@@ -1186,7 +1186,7 @@
1186
1186
  </div>
1187
1187
 
1188
1188
  <div id="footer">
1189
- Generated on Thu Nov 20 12:44:24 2025 by
1189
+ Generated on Thu Nov 27 16:02:23 2025 by
1190
1190
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1191
1191
  0.9.34 (ruby-3.3.5).
1192
1192
  </div>
@@ -354,7 +354,7 @@
354
354
  </div>
355
355
 
356
356
  <div id="footer">
357
- Generated on Thu Nov 20 12:44:24 2025 by
357
+ Generated on Thu Nov 27 16:02:23 2025 by
358
358
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
359
359
  0.9.34 (ruby-3.3.5).
360
360
  </div>
@@ -289,7 +289,7 @@
289
289
  </div>
290
290
 
291
291
  <div id="footer">
292
- Generated on Thu Nov 20 12:44:24 2025 by
292
+ Generated on Thu Nov 27 16:02:23 2025 by
293
293
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
294
294
  0.9.34 (ruby-3.3.5).
295
295
  </div>
@@ -222,7 +222,7 @@
222
222
  </div>
223
223
 
224
224
  <div id="footer">
225
- Generated on Thu Nov 20 12:44:24 2025 by
225
+ Generated on Thu Nov 27 16:02:23 2025 by
226
226
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
227
227
  0.9.34 (ruby-3.3.5).
228
228
  </div>
@@ -222,7 +222,7 @@
222
222
  </div>
223
223
 
224
224
  <div id="footer">
225
- Generated on Thu Nov 20 12:44:24 2025 by
225
+ Generated on Thu Nov 27 16:02:23 2025 by
226
226
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
227
227
  0.9.34 (ruby-3.3.5).
228
228
  </div>
@@ -222,7 +222,7 @@
222
222
  </div>
223
223
 
224
224
  <div id="footer">
225
- Generated on Thu Nov 20 12:44:24 2025 by
225
+ Generated on Thu Nov 27 16:02:23 2025 by
226
226
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
227
227
  0.9.34 (ruby-3.3.5).
228
228
  </div>
@@ -144,7 +144,7 @@
144
144
  </div>
145
145
 
146
146
  <div id="footer">
147
- Generated on Thu Nov 20 12:44:24 2025 by
147
+ Generated on Thu Nov 27 16:02:23 2025 by
148
148
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
149
149
  0.9.34 (ruby-3.3.5).
150
150
  </div>
@@ -230,7 +230,7 @@
230
230
  </div>
231
231
 
232
232
  <div id="footer">
233
- Generated on Thu Nov 20 12:44:24 2025 by
233
+ Generated on Thu Nov 27 16:02:23 2025 by
234
234
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
235
235
  0.9.34 (ruby-3.3.5).
236
236
  </div>
@@ -144,7 +144,7 @@
144
144
  </div>
145
145
 
146
146
  <div id="footer">
147
- Generated on Thu Nov 20 12:44:24 2025 by
147
+ Generated on Thu Nov 27 16:02:23 2025 by
148
148
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
149
149
  0.9.34 (ruby-3.3.5).
150
150
  </div>
@@ -222,7 +222,7 @@
222
222
  </div>
223
223
 
224
224
  <div id="footer">
225
- Generated on Thu Nov 20 12:44:24 2025 by
225
+ Generated on Thu Nov 27 16:02:23 2025 by
226
226
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
227
227
  0.9.34 (ruby-3.3.5).
228
228
  </div>
@@ -222,7 +222,7 @@
222
222
  </div>
223
223
 
224
224
  <div id="footer">
225
- Generated on Thu Nov 20 12:44:25 2025 by
225
+ Generated on Thu Nov 27 16:02:23 2025 by
226
226
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
227
227
  0.9.34 (ruby-3.3.5).
228
228
  </div>
@@ -291,7 +291,7 @@
291
291
  </div>
292
292
 
293
293
  <div id="footer">
294
- Generated on Thu Nov 20 12:44:24 2025 by
294
+ Generated on Thu Nov 27 16:02:23 2025 by
295
295
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
296
296
  0.9.34 (ruby-3.3.5).
297
297
  </div>
@@ -222,7 +222,7 @@
222
222
  </div>
223
223
 
224
224
  <div id="footer">
225
- Generated on Thu Nov 20 12:44:24 2025 by
225
+ Generated on Thu Nov 27 16:02:23 2025 by
226
226
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
227
227
  0.9.34 (ruby-3.3.5).
228
228
  </div>
@@ -144,7 +144,7 @@
144
144
  </div>
145
145
 
146
146
  <div id="footer">
147
- Generated on Thu Nov 20 12:44:24 2025 by
147
+ Generated on Thu Nov 27 16:02:23 2025 by
148
148
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
149
149
  0.9.34 (ruby-3.3.5).
150
150
  </div>
@@ -144,7 +144,7 @@
144
144
  </div>
145
145
 
146
146
  <div id="footer">
147
- Generated on Thu Nov 20 12:44:24 2025 by
147
+ Generated on Thu Nov 27 16:02:23 2025 by
148
148
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
149
149
  0.9.34 (ruby-3.3.5).
150
150
  </div>
@@ -144,7 +144,7 @@
144
144
  </div>
145
145
 
146
146
  <div id="footer">
147
- Generated on Thu Nov 20 12:44:24 2025 by
147
+ Generated on Thu Nov 27 16:02:23 2025 by
148
148
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
149
149
  0.9.34 (ruby-3.3.5).
150
150
  </div>
@@ -230,7 +230,7 @@
230
230
  </div>
231
231
 
232
232
  <div id="footer">
233
- Generated on Thu Nov 20 12:44:24 2025 by
233
+ Generated on Thu Nov 27 16:02:22 2025 by
234
234
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
235
235
  0.9.34 (ruby-3.3.5).
236
236
  </div>
@@ -116,7 +116,7 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Thu Nov 20 12:44:23 2025 by
119
+ Generated on Thu Nov 27 16:02:22 2025 by
120
120
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
121
  0.9.34 (ruby-3.3.5).
122
122
  </div>
@@ -519,7 +519,7 @@
519
519
  </div>
520
520
 
521
521
  <div id="footer">
522
- Generated on Thu Nov 20 12:44:23 2025 by
522
+ Generated on Thu Nov 27 16:02:22 2025 by
523
523
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
524
524
  0.9.34 (ruby-3.3.5).
525
525
  </div>
@@ -290,7 +290,7 @@
290
290
  </div>
291
291
 
292
292
  <div id="footer">
293
- Generated on Thu Nov 20 12:44:24 2025 by
293
+ Generated on Thu Nov 27 16:02:23 2025 by
294
294
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
295
295
  0.9.34 (ruby-3.3.5).
296
296
  </div>
@@ -278,7 +278,9 @@
278
278
 
279
279
 
280
280
 
281
- <span class="summary_desc"><div class='inline'></div></span>
281
+ <span class="summary_desc"><div class='inline'>
282
+ <p>Like <span class='object_link'><a href="#content-instance_method" title="Compony::RequestContext#content (method)">#content</a></span>, but fails if no such content block exists.</p>
283
+ </div></span>
282
284
 
283
285
  </li>
284
286
 
@@ -352,6 +354,54 @@
352
354
  <p>Provide access to local assigns as if it were a Rails context.</p>
353
355
  </div></span>
354
356
 
357
+ </li>
358
+
359
+
360
+ <li class="public ">
361
+ <span class="summary_signature">
362
+
363
+ <a href="#render_intent-instance_method" title="#render_intent (instance method)">#<strong>render_intent</strong>(button: {}) &#x21d2; Object </a>
364
+
365
+
366
+
367
+ </span>
368
+
369
+
370
+
371
+
372
+
373
+
374
+
375
+
376
+
377
+ <span class="summary_desc"><div class='inline'>
378
+ <p>View helper that renders an intent through the default button class.</p>
379
+ </div></span>
380
+
381
+ </li>
382
+
383
+
384
+ <li class="public ">
385
+ <span class="summary_signature">
386
+
387
+ <a href="#render_sub_comp-instance_method" title="#render_sub_comp (instance method)">#<strong>render_sub_comp</strong> &#x21d2; Object </a>
388
+
389
+
390
+
391
+ </span>
392
+
393
+
394
+
395
+
396
+
397
+
398
+
399
+
400
+
401
+ <span class="summary_desc"><div class='inline'>
402
+ <p>View helper that instanciates a sub comp and renders it.</p>
403
+ </div></span>
404
+
355
405
  </li>
356
406
 
357
407
 
@@ -700,7 +750,7 @@
700
750
  </h3><div class="docstring">
701
751
  <div class="discussion">
702
752
 
703
- <p>Renders a content block from the current component.</p>
753
+ <p>Renders a content block from the current component. Does nothing if no such content block exists.</p>
704
754
 
705
755
 
706
756
  </div>
@@ -714,11 +764,6 @@
714
764
  <pre class="lines">
715
765
 
716
766
 
717
- 46
718
- 47
719
- 48
720
- 49
721
- 50
722
767
  51
723
768
  52
724
769
  53
@@ -728,10 +773,15 @@
728
773
  57
729
774
  58
730
775
  59
731
- 60</pre>
776
+ 60
777
+ 61
778
+ 62
779
+ 63
780
+ 64
781
+ 65</pre>
732
782
  </td>
733
783
  <td>
734
- <pre class="code"><span class="info file"># File 'lib/compony/request_context.rb', line 46</span>
784
+ <pre class="code"><span class="info file"># File 'lib/compony/request_context.rb', line 51</span>
735
785
 
736
786
  <span class='kw'>def</span> <span class='id identifier rubyid_content'>content</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='comment'># rubocop:disable Naming/PredicateMethod
737
787
  </span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
@@ -765,24 +815,33 @@
765
815
  </h3><div class="docstring">
766
816
  <div class="discussion">
767
817
 
818
+ <p>Like <span class='object_link'><a href="#content-instance_method" title="Compony::RequestContext#content (method)">#content</a></span>, but fails if no such content block exists.</p>
819
+
768
820
 
769
821
  </div>
770
822
  </div>
771
823
  <div class="tags">
772
824
 
773
825
 
826
+ <p class="tag_title">See Also:</p>
827
+ <ul class="see">
828
+
829
+ <li><span class='object_link'><a href="#content-instance_method" title="Compony::RequestContext#content (method)">#content</a></span></li>
830
+
831
+ </ul>
832
+
774
833
  </div><table class="source_code">
775
834
  <tr>
776
835
  <td>
777
836
  <pre class="lines">
778
837
 
779
838
 
780
- 62
781
- 63
782
- 64</pre>
839
+ 69
840
+ 70
841
+ 71</pre>
783
842
  </td>
784
843
  <td>
785
- <pre class="code"><span class="info file"># File 'lib/compony/request_context.rb', line 62</span>
844
+ <pre class="code"><span class="info file"># File 'lib/compony/request_context.rb', line 69</span>
786
845
 
787
846
  <span class='kw'>def</span> <span class='id identifier rubyid_content!'>content!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
788
847
  <span class='id identifier rubyid_content'>content</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Content block </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'> not found in </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
@@ -829,6 +888,110 @@
829
888
  </td>
830
889
  </tr>
831
890
  </table>
891
+ </div>
892
+
893
+ <div class="method_details ">
894
+ <h3 class="signature " id="render_intent-instance_method">
895
+
896
+ #<strong>render_intent</strong>(button: {}) &#x21d2; <tt>Object</tt>
897
+
898
+
899
+
900
+
901
+
902
+ </h3><div class="docstring">
903
+ <div class="discussion">
904
+
905
+ <p>View helper that renders an intent through the default button class. All non-mentioned parameters are given to the intent initializer. When inside a request context (<code>content do...</code>), this precedes <span class='object_link'><a href="ViewHelpers.html#render_intent-instance_method" title="Compony::ViewHelpers#render_intent (method)">ViewHelpers#render_intent</a></span>.</p>
906
+
907
+
908
+ </div>
909
+ </div>
910
+ <div class="tags">
911
+ <p class="tag_title">Parameters:</p>
912
+ <ul class="param">
913
+
914
+ <li>
915
+
916
+ <span class='name'>button</span>
917
+
918
+
919
+ <span class='type'>(<tt>Hash</tt>)</span>
920
+
921
+
922
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
923
+
924
+
925
+ &mdash;
926
+ <div class='inline'>
927
+ <p>Parameters that will be given to the button component initializer.</p>
928
+ </div>
929
+
930
+ </li>
931
+
932
+ </ul>
933
+
934
+
935
+ </div><table class="source_code">
936
+ <tr>
937
+ <td>
938
+ <pre class="lines">
939
+
940
+
941
+ 77
942
+ 78
943
+ 79</pre>
944
+ </td>
945
+ <td>
946
+ <pre class="code"><span class="info file"># File 'lib/compony/request_context.rb', line 77</span>
947
+
948
+ <span class='kw'>def</span> <span class='id identifier rubyid_render_intent'>render_intent</span><span class='lparen'>(</span><span class='op'>*</span><span class='comma'>,</span> <span class='label'>button:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>**</span><span class='rparen'>)</span>
949
+ <span class='const'><span class='object_link'><a href="../Compony.html" title="Compony (module)">Compony</a></span></span><span class='period'>.</span><span class='id identifier rubyid_intent'><span class='object_link'><a href="../Compony.html#intent-class_method" title="Compony.intent (method)">intent</a></span></span><span class='lparen'>(</span><span class='op'>*</span><span class='comma'>,</span> <span class='op'>**</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='id identifier rubyid_controller'>controller</span><span class='comma'>,</span> <span class='id identifier rubyid_component'>component</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_button'>button</span><span class='rparen'>)</span>
950
+ <span class='kw'>end</span></pre>
951
+ </td>
952
+ </tr>
953
+ </table>
954
+ </div>
955
+
956
+ <div class="method_details ">
957
+ <h3 class="signature " id="render_sub_comp-instance_method">
958
+
959
+ #<strong>render_sub_comp</strong> &#x21d2; <tt>Object</tt>
960
+
961
+
962
+
963
+
964
+
965
+ </h3><div class="docstring">
966
+ <div class="discussion">
967
+
968
+ <p>View helper that instanciates a sub comp and renders it. Example usage: <code>concat render_sub_comp(Components::Something::Nested)</code></p>
969
+
970
+
971
+ </div>
972
+ </div>
973
+ <div class="tags">
974
+
975
+
976
+ </div><table class="source_code">
977
+ <tr>
978
+ <td>
979
+ <pre class="lines">
980
+
981
+
982
+ 83
983
+ 84
984
+ 85</pre>
985
+ </td>
986
+ <td>
987
+ <pre class="code"><span class="info file"># File 'lib/compony/request_context.rb', line 83</span>
988
+
989
+ <span class='kw'>def</span> <span class='id identifier rubyid_render_sub_comp'>render_sub_comp</span><span class='lparen'>(</span><span class='op'>...</span><span class='rparen'>)</span>
990
+ <span class='id identifier rubyid_sub_comp'>sub_comp</span><span class='lparen'>(</span><span class='op'>...</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='id identifier rubyid_controller'>controller</span><span class='rparen'>)</span>
991
+ <span class='kw'>end</span></pre>
992
+ </td>
993
+ </tr>
994
+ </table>
832
995
  </div>
833
996
 
834
997
  <div class="method_details ">
@@ -931,7 +1094,7 @@
931
1094
  </div>
932
1095
 
933
1096
  <div id="footer">
934
- Generated on Thu Nov 20 12:44:24 2025 by
1097
+ Generated on Thu Nov 27 16:02:22 2025 by
935
1098
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
936
1099
  0.9.34 (ruby-3.3.5).
937
1100
  </div>
@@ -129,7 +129,7 @@
129
129
  </div>
130
130
 
131
131
  <div id="footer">
132
- Generated on Thu Nov 20 12:44:23 2025 by
132
+ Generated on Thu Nov 27 16:02:22 2025 by
133
133
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
134
134
  0.9.34 (ruby-3.3.5).
135
135
  </div>