compony 0.11.8 → 0.11.10
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/.ruby-version +1 -1
- data/.yardopts +36 -1
- data/CHANGELOG.md +43 -0
- data/CLAUDE.md +85 -0
- data/Gemfile.lock +1 -1
- data/README.md +13 -3
- data/VERSION +1 -1
- data/compony.gemspec +4 -4
- data/doc/ComponentGenerator.html +2 -2
- data/doc/Components.html +2 -2
- data/doc/ComponentsGenerator.html +2 -2
- data/doc/Compony/Component.html +55 -55
- data/doc/Compony/ComponentMixins/Default/Labelling.html +2 -2
- data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +2 -2
- data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +110 -71
- data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +65 -29
- data/doc/Compony/ComponentMixins/Default/Standalone.html +2 -2
- data/doc/Compony/ComponentMixins/Default.html +2 -2
- data/doc/Compony/ComponentMixins/Resourceful.html +214 -75
- data/doc/Compony/ComponentMixins.html +2 -2
- data/doc/Compony/Components/Buttons/CssButton.html +2 -2
- data/doc/Compony/Components/Buttons/Link.html +2 -2
- data/doc/Compony/Components/Buttons.html +2 -2
- data/doc/Compony/Components/Destroy.html +84 -30
- data/doc/Compony/Components/Edit.html +111 -39
- data/doc/Compony/Components/Form.html +552 -209
- data/doc/Compony/Components/Index.html +2 -2
- data/doc/Compony/Components/List.html +51 -35
- data/doc/Compony/Components/New.html +111 -39
- data/doc/Compony/Components/Show.html +2 -2
- data/doc/Compony/Components/WithForm.html +195 -48
- data/doc/Compony/Components.html +2 -2
- data/doc/Compony/ControllerMixin.html +2 -2
- data/doc/Compony/Engine.html +2 -2
- data/doc/Compony/Intent.html +3 -3
- data/doc/Compony/ManageIntentsDsl.html +2 -2
- data/doc/Compony/MethodAccessibleHash.html +2 -2
- data/doc/Compony/ModelFields/Anchormodel.html +2 -2
- data/doc/Compony/ModelFields/Association.html +2 -2
- data/doc/Compony/ModelFields/Attachment.html +2 -2
- data/doc/Compony/ModelFields/Base.html +2 -2
- data/doc/Compony/ModelFields/Boolean.html +2 -2
- data/doc/Compony/ModelFields/Color.html +2 -2
- data/doc/Compony/ModelFields/Currency.html +2 -2
- data/doc/Compony/ModelFields/Date.html +2 -2
- data/doc/Compony/ModelFields/Datetime.html +2 -2
- data/doc/Compony/ModelFields/Decimal.html +2 -2
- data/doc/Compony/ModelFields/Email.html +2 -2
- data/doc/Compony/ModelFields/Float.html +2 -2
- data/doc/Compony/ModelFields/Integer.html +2 -2
- data/doc/Compony/ModelFields/Percentage.html +2 -2
- data/doc/Compony/ModelFields/Phone.html +2 -2
- data/doc/Compony/ModelFields/RichText.html +2 -2
- data/doc/Compony/ModelFields/String.html +2 -2
- data/doc/Compony/ModelFields/Text.html +2 -2
- data/doc/Compony/ModelFields/Time.html +2 -2
- data/doc/Compony/ModelFields/Url.html +2 -2
- data/doc/Compony/ModelFields.html +2 -2
- data/doc/Compony/ModelMixin.html +36 -36
- data/doc/Compony/NaturalOrdering.html +2 -2
- data/doc/Compony/RequestContext.html +2 -2
- data/doc/Compony/Version.html +2 -2
- data/doc/Compony/ViewHelpers.html +2 -2
- data/doc/Compony/VirtualModel.html +2 -2
- data/doc/Compony.html +33 -37
- data/doc/ComponyController.html +2 -2
- data/doc/_index.html +98 -2
- data/doc/file.CHANGELOG.html +765 -0
- data/doc/file.README.html +26 -5
- 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 +26 -5
- data/doc/integrations.md +61 -0
- data/doc/llms.txt +62 -0
- data/doc/top-level-namespace.html +2 -2
- 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 +9 -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
- data/lib/compony/model_mixin.rb +66 -3
- data/lib/compony.rb +4 -6
- metadata +44 -2
|
@@ -162,9 +162,9 @@
|
|
|
162
162
|
</div>
|
|
163
163
|
|
|
164
164
|
<div id="footer">
|
|
165
|
-
Generated on
|
|
165
|
+
Generated on Thu Jun 4 20:37:18 2026 by
|
|
166
166
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
167
|
-
0.9.34 (ruby-3.
|
|
167
|
+
0.9.34 (ruby-3.4.9).
|
|
168
168
|
</div>
|
|
169
169
|
|
|
170
170
|
</div>
|
|
@@ -546,7 +546,7 @@
|
|
|
546
546
|
|
|
547
547
|
|
|
548
548
|
<span class="summary_desc"><div class='inline'>
|
|
549
|
-
<p>DSL method If a block is given: Enters the DSL where row intents can be added or removed (use from Component#setup within the component).</p>
|
|
549
|
+
<p>DSL method If a block is given: Enters the DSL where row intents can be added or removed (use from <span class='object_link'><a href="../Component.html#setup-class_method" title="Compony::Component.setup (method)">Compony::Component.setup</a></span> within the component).</p>
|
|
550
550
|
</div></span>
|
|
551
551
|
|
|
552
552
|
</li>
|
|
@@ -1809,12 +1809,12 @@
|
|
|
1809
1809
|
<pre class="lines">
|
|
1810
1810
|
|
|
1811
1811
|
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1812
|
+
398
|
|
1813
|
+
399
|
|
1814
|
+
400</pre>
|
|
1815
1815
|
</td>
|
|
1816
1816
|
<td>
|
|
1817
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
1817
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 398</span>
|
|
1818
1818
|
|
|
1819
1819
|
<span class='kw'>def</span> <span class='id identifier rubyid_filtering_enabled?'>filtering_enabled?</span>
|
|
1820
1820
|
<span class='ivar'>@filtering</span> <span class='op'>&&</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='const'>Ransack</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@skip_filtering</span>
|
|
@@ -1945,12 +1945,12 @@
|
|
|
1945
1945
|
<pre class="lines">
|
|
1946
1946
|
|
|
1947
1947
|
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1948
|
+
418
|
|
1949
|
+
419
|
|
1950
|
+
420</pre>
|
|
1951
1951
|
</td>
|
|
1952
1952
|
<td>
|
|
1953
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
1953
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 418</span>
|
|
1954
1954
|
|
|
1955
1955
|
<span class='kw'>def</span> <span class='id identifier rubyid_pagination_enabled?'>pagination_enabled?</span>
|
|
1956
1956
|
<span class='ivar'>@pagination</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@skip_pagination</span>
|
|
@@ -2019,7 +2019,15 @@
|
|
|
2019
2019
|
263
|
|
2020
2020
|
264
|
|
2021
2021
|
265
|
|
2022
|
-
266
|
|
2022
|
+
266
|
|
2023
|
+
267
|
|
2024
|
+
268
|
|
2025
|
+
269
|
|
2026
|
+
270
|
|
2027
|
+
271
|
|
2028
|
+
272
|
|
2029
|
+
273
|
|
2030
|
+
274</pre>
|
|
2023
2031
|
</td>
|
|
2024
2032
|
<td>
|
|
2025
2033
|
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 233</span>
|
|
@@ -2050,6 +2058,14 @@
|
|
|
2050
2058
|
<span class='ivar'>@total_pages</span> <span class='op'>=</span> <span class='int'>1</span>
|
|
2051
2059
|
<span class='ivar'>@pagination_offset</span> <span class='op'>=</span> <span class='int'>0</span>
|
|
2052
2060
|
<span class='kw'>end</span>
|
|
2061
|
+
<span class='comment'># Batch-precompute feasibility for the records on this page, avoiding N+1 queries from per-row destroy buttons (see ModelMixin#precompute_feasibility).
|
|
2062
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_data_class'>data_class</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:precompute_feasibility</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@skip_row_intents</span>
|
|
2063
|
+
<span class='id identifier rubyid_page_records'>page_records</span> <span class='op'>=</span> <span class='ivar'>@processed_data</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span>
|
|
2064
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_page_records'>page_records</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
|
|
2065
|
+
<span class='id identifier rubyid_action_names'>action_names</span> <span class='op'>=</span> <span class='id identifier rubyid_row_intents'>row_intents</span><span class='lparen'>(</span><span class='label'>data:</span> <span class='id identifier rubyid_page_records'>page_records</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_uniq'>uniq</span>
|
|
2066
|
+
<span class='id identifier rubyid_action_names'>action_names</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_action_name'>action_name</span><span class='op'>|</span> <span class='id identifier rubyid_data_class'>data_class</span><span class='period'>.</span><span class='id identifier rubyid_precompute_feasibility'>precompute_feasibility</span><span class='lparen'>(</span><span class='id identifier rubyid_page_records'>page_records</span><span class='comma'>,</span> <span class='id identifier rubyid_action_name'>action_name</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
2067
|
+
<span class='kw'>end</span>
|
|
2068
|
+
<span class='kw'>end</span>
|
|
2053
2069
|
<span class='comment'># Apply skips to configs
|
|
2054
2070
|
</span> <span class='comment'># Exclude columns that are skipped or the user is not allowed to display
|
|
2055
2071
|
</span> <span class='ivar'>@columns</span><span class='period'>.</span><span class='id identifier rubyid_select!'>select!</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_col'>col</span><span class='comma'>,</span> <span class='id identifier rubyid__'>_</span><span class='op'>|</span>
|
|
@@ -2116,7 +2132,7 @@
|
|
|
2116
2132
|
</h3><div class="docstring">
|
|
2117
2133
|
<div class="discussion">
|
|
2118
2134
|
|
|
2119
|
-
<p>DSL method If a block is given: Enters the DSL where row intents can be added or removed (use from Component#setup within the component). If no block is given: Builds the declared intents for the given record and returns them (use in <code>content</code> or <code>before_render</code>, pass kwarg <code>:data</code>).</p>
|
|
2135
|
+
<p>DSL method If a block is given: Enters the DSL where row intents can be added or removed (use from <span class='object_link'><a href="../Component.html#setup-class_method" title="Compony::Component.setup (method)">Compony::Component.setup</a></span> within the component). If no block is given: Builds the declared intents for the given record and returns them (use in <code>content</code> or <code>before_render</code>, pass kwarg <code>:data</code>).</p>
|
|
2120
2136
|
|
|
2121
2137
|
|
|
2122
2138
|
</div>
|
|
@@ -2385,12 +2401,12 @@
|
|
|
2385
2401
|
<pre class="lines">
|
|
2386
2402
|
|
|
2387
2403
|
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2404
|
+
403
|
|
2405
|
+
404
|
|
2406
|
+
405</pre>
|
|
2391
2407
|
</td>
|
|
2392
2408
|
<td>
|
|
2393
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
2409
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 403</span>
|
|
2394
2410
|
|
|
2395
2411
|
<span class='kw'>def</span> <span class='id identifier rubyid_sorting_enabled?'>sorting_enabled?</span>
|
|
2396
2412
|
<span class='lparen'>(</span><span class='lparen'>(</span><span class='ivar'>@sorting_in_filter</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@skip_sorting_in_filter</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='ivar'>@sorting_links</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@skip_sorting_links</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='const'>Ransack</span><span class='rparen'>)</span>
|
|
@@ -2480,12 +2496,12 @@
|
|
|
2480
2496
|
<pre class="lines">
|
|
2481
2497
|
|
|
2482
2498
|
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2499
|
+
408
|
|
2500
|
+
409
|
|
2501
|
+
410</pre>
|
|
2486
2502
|
</td>
|
|
2487
2503
|
<td>
|
|
2488
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
2504
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 408</span>
|
|
2489
2505
|
|
|
2490
2506
|
<span class='kw'>def</span> <span class='id identifier rubyid_sorting_in_filter_enabled?'>sorting_in_filter_enabled?</span>
|
|
2491
2507
|
<span class='id identifier rubyid_sorting_enabled?'>sorting_enabled?</span> <span class='op'>&&</span> <span class='ivar'>@sorting_in_filter</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@skip_sorting_in_filter</span>
|
|
@@ -2521,18 +2537,18 @@
|
|
|
2521
2537
|
<pre class="lines">
|
|
2522
2538
|
|
|
2523
2539
|
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2540
|
+
423
|
|
2541
|
+
424
|
|
2542
|
+
425
|
|
2543
|
+
426
|
|
2544
|
+
427
|
|
2545
|
+
428
|
|
2546
|
+
429
|
|
2547
|
+
430
|
|
2548
|
+
431</pre>
|
|
2533
2549
|
</td>
|
|
2534
2550
|
<td>
|
|
2535
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
2551
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 423</span>
|
|
2536
2552
|
|
|
2537
2553
|
<span class='kw'>def</span> <span class='id identifier rubyid_sorting_in_filter_select_opts'>sorting_in_filter_select_opts</span>
|
|
2538
2554
|
<span class='ivar'>@sorts</span><span class='period'>.</span><span class='id identifier rubyid_flat_map'>flat_map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_sort'>sort</span><span class='op'>|</span>
|
|
@@ -2628,12 +2644,12 @@
|
|
|
2628
2644
|
<pre class="lines">
|
|
2629
2645
|
|
|
2630
2646
|
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2647
|
+
413
|
|
2648
|
+
414
|
|
2649
|
+
415</pre>
|
|
2634
2650
|
</td>
|
|
2635
2651
|
<td>
|
|
2636
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
2652
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 413</span>
|
|
2637
2653
|
|
|
2638
2654
|
<span class='kw'>def</span> <span class='id identifier rubyid_sorting_links_enabled?'>sorting_links_enabled?</span>
|
|
2639
2655
|
<span class='id identifier rubyid_sorting_enabled?'>sorting_enabled?</span> <span class='op'>&&</span> <span class='ivar'>@sorting_links</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@skip_sorting_links</span>
|
|
@@ -2689,9 +2705,9 @@
|
|
|
2689
2705
|
</div>
|
|
2690
2706
|
|
|
2691
2707
|
<div id="footer">
|
|
2692
|
-
Generated on
|
|
2708
|
+
Generated on Thu Jun 4 20:37:18 2026 by
|
|
2693
2709
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
2694
|
-
0.9.34 (ruby-3.
|
|
2710
|
+
0.9.34 (ruby-3.4.9).
|
|
2695
2711
|
</div>
|
|
2696
2712
|
|
|
2697
2713
|
</div>
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
|
|
139
139
|
|
|
140
140
|
<h2>
|
|
141
|
-
|
|
141
|
+
DSL
|
|
142
142
|
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
143
143
|
</h2>
|
|
144
144
|
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
<li class="public ">
|
|
148
148
|
<span class="summary_signature">
|
|
149
149
|
|
|
150
|
-
<a href="#on_create_failed_respond-instance_method" title="#on_create_failed_respond (instance method)">#<strong>on_create_failed_respond</strong>
|
|
150
|
+
<a href="#on_create_failed_respond-instance_method" title="#on_create_failed_respond (instance method)">#<strong>on_create_failed_respond</strong> { ... } ⇒ void </a>
|
|
151
151
|
|
|
152
152
|
|
|
153
153
|
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
|
|
163
163
|
|
|
164
164
|
<span class="summary_desc"><div class='inline'>
|
|
165
|
-
<p>DSL method.</p>
|
|
165
|
+
<p>DSL method Overrides the response issued when the create failed (<code>@create_succeeded</code> is not true).</p>
|
|
166
166
|
</div></span>
|
|
167
167
|
|
|
168
168
|
</li>
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
<li class="public ">
|
|
172
172
|
<span class="summary_signature">
|
|
173
173
|
|
|
174
|
-
<a href="#on_created-instance_method" title="#on_created (instance method)">#<strong>on_created</strong>
|
|
174
|
+
<a href="#on_created-instance_method" title="#on_created (instance method)">#<strong>on_created</strong> { ... } ⇒ void </a>
|
|
175
175
|
|
|
176
176
|
|
|
177
177
|
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
|
|
187
187
|
|
|
188
188
|
<span class="summary_desc"><div class='inline'>
|
|
189
|
-
<p>DSL method Sets
|
|
189
|
+
<p>DSL method Sets an optional hook evaluated (with backfire) after a successful create but before responding.</p>
|
|
190
190
|
</div></span>
|
|
191
191
|
|
|
192
192
|
</li>
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
<li class="public ">
|
|
196
196
|
<span class="summary_signature">
|
|
197
197
|
|
|
198
|
-
<a href="#on_created_redirect_path-instance_method" title="#on_created_redirect_path (instance method)">#<strong>on_created_redirect_path</strong>
|
|
198
|
+
<a href="#on_created_redirect_path-instance_method" title="#on_created_redirect_path (instance method)">#<strong>on_created_redirect_path</strong> { ... } ⇒ void </a>
|
|
199
199
|
|
|
200
200
|
|
|
201
201
|
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
|
|
211
211
|
|
|
212
212
|
<span class="summary_desc"><div class='inline'>
|
|
213
|
-
<p>DSL method.</p>
|
|
213
|
+
<p>DSL method Overrides the redirect target used by the default <span class='object_link'><a href="#on_created_respond-instance_method" title="Compony::Components::New#on_created_respond (method)">#on_created_respond</a></span> (keeping the default flash).</p>
|
|
214
214
|
</div></span>
|
|
215
215
|
|
|
216
216
|
</li>
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
<li class="public ">
|
|
220
220
|
<span class="summary_signature">
|
|
221
221
|
|
|
222
|
-
<a href="#on_created_respond-instance_method" title="#on_created_respond (instance method)">#<strong>on_created_respond</strong>
|
|
222
|
+
<a href="#on_created_respond-instance_method" title="#on_created_respond (instance method)">#<strong>on_created_respond</strong> { ... } ⇒ void </a>
|
|
223
223
|
|
|
224
224
|
|
|
225
225
|
|
|
@@ -234,7 +234,7 @@
|
|
|
234
234
|
|
|
235
235
|
|
|
236
236
|
<span class="summary_desc"><div class='inline'>
|
|
237
|
-
<p>DSL method.</p>
|
|
237
|
+
<p>DSL method Overrides the response issued after a successful create.</p>
|
|
238
238
|
</div></span>
|
|
239
239
|
|
|
240
240
|
</li>
|
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
<div class="method_details first">
|
|
287
287
|
<h3 class="signature first" id="on_create_failed_respond-instance_method">
|
|
288
288
|
|
|
289
|
-
#<strong>on_create_failed_respond</strong>
|
|
289
|
+
#<strong>on_create_failed_respond</strong> { ... } ⇒ <tt>void</tt>
|
|
290
290
|
|
|
291
291
|
|
|
292
292
|
|
|
@@ -294,14 +294,32 @@
|
|
|
294
294
|
|
|
295
295
|
</h3><div class="docstring">
|
|
296
296
|
<div class="discussion">
|
|
297
|
-
|
|
298
|
-
<p>DSL method</p>
|
|
297
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
298
|
+
<p>DSL method Overrides the response issued when the create failed (<code>@create_succeeded</code> is not true). The default logs the errors with level <code>warn</code> and re-renders the component with HTTP 422 so the form shows errors.</p>
|
|
299
299
|
|
|
300
300
|
|
|
301
301
|
</div>
|
|
302
302
|
</div>
|
|
303
303
|
<div class="tags">
|
|
304
304
|
|
|
305
|
+
<p class="tag_title">Yields:</p>
|
|
306
|
+
<ul class="yield">
|
|
307
|
+
|
|
308
|
+
<li>
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
<span class='type'></span>
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
<div class='inline'>
|
|
317
|
+
<p>Runs in the component’s request context; expected to render or redirect.</p>
|
|
318
|
+
</div>
|
|
319
|
+
|
|
320
|
+
</li>
|
|
321
|
+
|
|
322
|
+
</ul>
|
|
305
323
|
|
|
306
324
|
</div><table class="source_code">
|
|
307
325
|
<tr>
|
|
@@ -309,12 +327,12 @@
|
|
|
309
327
|
<pre class="lines">
|
|
310
328
|
|
|
311
329
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
330
|
+
120
|
|
331
|
+
121
|
|
332
|
+
122</pre>
|
|
315
333
|
</td>
|
|
316
334
|
<td>
|
|
317
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/new.rb', line
|
|
335
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/new.rb', line 120</span>
|
|
318
336
|
|
|
319
337
|
<span class='kw'>def</span> <span class='id identifier rubyid_on_create_failed_respond'>on_create_failed_respond</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
320
338
|
<span class='ivar'>@on_create_failed_respond_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
@@ -327,7 +345,7 @@
|
|
|
327
345
|
<div class="method_details ">
|
|
328
346
|
<h3 class="signature " id="on_created-instance_method">
|
|
329
347
|
|
|
330
|
-
#<strong>on_created</strong>
|
|
348
|
+
#<strong>on_created</strong> { ... } ⇒ <tt>void</tt>
|
|
331
349
|
|
|
332
350
|
|
|
333
351
|
|
|
@@ -335,14 +353,32 @@
|
|
|
335
353
|
|
|
336
354
|
</h3><div class="docstring">
|
|
337
355
|
<div class="discussion">
|
|
338
|
-
|
|
339
|
-
<p>DSL method Sets
|
|
356
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
357
|
+
<p>DSL method Sets an optional hook evaluated (with backfire) after a successful create but before responding. Suitable for post-create side effects (like an <code>after_create</code> that only fires when this component created the record). Do not redirect or render here - use <span class='object_link'><a href="#on_created_respond-instance_method" title="Compony::Components::New#on_created_respond (method)">#on_created_respond</a></span> / <span class='object_link'><a href="#on_created_redirect_path-instance_method" title="Compony::Components::New#on_created_redirect_path (method)">#on_created_redirect_path</a></span> for that.</p>
|
|
340
358
|
|
|
341
359
|
|
|
342
360
|
</div>
|
|
343
361
|
</div>
|
|
344
362
|
<div class="tags">
|
|
345
363
|
|
|
364
|
+
<p class="tag_title">Yields:</p>
|
|
365
|
+
<ul class="yield">
|
|
366
|
+
|
|
367
|
+
<li>
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
<span class='type'></span>
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
<div class='inline'>
|
|
376
|
+
<p>Runs in the component’s request context after <code>@data</code> was saved successfully.</p>
|
|
377
|
+
</div>
|
|
378
|
+
|
|
379
|
+
</li>
|
|
380
|
+
|
|
381
|
+
</ul>
|
|
346
382
|
|
|
347
383
|
</div><table class="source_code">
|
|
348
384
|
<tr>
|
|
@@ -350,12 +386,12 @@
|
|
|
350
386
|
<pre class="lines">
|
|
351
387
|
|
|
352
388
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
389
|
+
90
|
|
390
|
+
91
|
|
391
|
+
92</pre>
|
|
356
392
|
</td>
|
|
357
393
|
<td>
|
|
358
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/new.rb', line
|
|
394
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/new.rb', line 90</span>
|
|
359
395
|
|
|
360
396
|
<span class='kw'>def</span> <span class='id identifier rubyid_on_created'>on_created</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
361
397
|
<span class='ivar'>@on_created_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
@@ -368,7 +404,7 @@
|
|
|
368
404
|
<div class="method_details ">
|
|
369
405
|
<h3 class="signature " id="on_created_redirect_path-instance_method">
|
|
370
406
|
|
|
371
|
-
#<strong>on_created_redirect_path</strong>
|
|
407
|
+
#<strong>on_created_redirect_path</strong> { ... } ⇒ <tt>void</tt>
|
|
372
408
|
|
|
373
409
|
|
|
374
410
|
|
|
@@ -376,14 +412,32 @@
|
|
|
376
412
|
|
|
377
413
|
</h3><div class="docstring">
|
|
378
414
|
<div class="discussion">
|
|
379
|
-
|
|
380
|
-
<p>DSL method</p>
|
|
415
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
416
|
+
<p>DSL method Overrides the redirect target used by the default <span class='object_link'><a href="#on_created_respond-instance_method" title="Compony::Components::New#on_created_respond (method)">#on_created_respond</a></span> (keeping the default flash). Defaults to the data’s Show, the owner’s Show, or the data’s Index.</p>
|
|
381
417
|
|
|
382
418
|
|
|
383
419
|
</div>
|
|
384
420
|
</div>
|
|
385
421
|
<div class="tags">
|
|
386
422
|
|
|
423
|
+
<p class="tag_title">Yields:</p>
|
|
424
|
+
<ul class="yield">
|
|
425
|
+
|
|
426
|
+
<li>
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
<span class='type'></span>
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
<div class='inline'>
|
|
435
|
+
<p>Runs in the component’s request context; expected to return a Rails path (e.g. via <code>Compony.path</code>).</p>
|
|
436
|
+
</div>
|
|
437
|
+
|
|
438
|
+
</li>
|
|
439
|
+
|
|
440
|
+
</ul>
|
|
387
441
|
|
|
388
442
|
</div><table class="source_code">
|
|
389
443
|
<tr>
|
|
@@ -391,12 +445,12 @@
|
|
|
391
445
|
<pre class="lines">
|
|
392
446
|
|
|
393
447
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
448
|
+
110
|
|
449
|
+
111
|
|
450
|
+
112</pre>
|
|
397
451
|
</td>
|
|
398
452
|
<td>
|
|
399
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/new.rb', line
|
|
453
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/new.rb', line 110</span>
|
|
400
454
|
|
|
401
455
|
<span class='kw'>def</span> <span class='id identifier rubyid_on_created_redirect_path'>on_created_redirect_path</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
402
456
|
<span class='ivar'>@on_created_redirect_path_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
@@ -409,7 +463,7 @@
|
|
|
409
463
|
<div class="method_details ">
|
|
410
464
|
<h3 class="signature " id="on_created_respond-instance_method">
|
|
411
465
|
|
|
412
|
-
#<strong>on_created_respond</strong>
|
|
466
|
+
#<strong>on_created_respond</strong> { ... } ⇒ <tt>void</tt>
|
|
413
467
|
|
|
414
468
|
|
|
415
469
|
|
|
@@ -417,14 +471,32 @@
|
|
|
417
471
|
|
|
418
472
|
</h3><div class="docstring">
|
|
419
473
|
<div class="discussion">
|
|
420
|
-
|
|
421
|
-
<p>DSL method</p>
|
|
474
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
475
|
+
<p>DSL method Overrides the response issued after a successful create. The default shows a flash and redirects to <span class='object_link'><a href="#on_created_redirect_path-instance_method" title="Compony::Components::New#on_created_redirect_path (method)">#on_created_redirect_path</a></span>. If you override this, <span class='object_link'><a href="#on_created_redirect_path-instance_method" title="Compony::Components::New#on_created_redirect_path (method)">#on_created_redirect_path</a></span> is no longer called.</p>
|
|
422
476
|
|
|
423
477
|
|
|
424
478
|
</div>
|
|
425
479
|
</div>
|
|
426
480
|
<div class="tags">
|
|
427
481
|
|
|
482
|
+
<p class="tag_title">Yields:</p>
|
|
483
|
+
<ul class="yield">
|
|
484
|
+
|
|
485
|
+
<li>
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
<span class='type'></span>
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
<div class='inline'>
|
|
494
|
+
<p>Runs in the component’s request context; expected to render or redirect.</p>
|
|
495
|
+
</div>
|
|
496
|
+
|
|
497
|
+
</li>
|
|
498
|
+
|
|
499
|
+
</ul>
|
|
428
500
|
|
|
429
501
|
</div><table class="source_code">
|
|
430
502
|
<tr>
|
|
@@ -432,12 +504,12 @@
|
|
|
432
504
|
<pre class="lines">
|
|
433
505
|
|
|
434
506
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
507
|
+
100
|
|
508
|
+
101
|
|
509
|
+
102</pre>
|
|
438
510
|
</td>
|
|
439
511
|
<td>
|
|
440
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/new.rb', line
|
|
512
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/new.rb', line 100</span>
|
|
441
513
|
|
|
442
514
|
<span class='kw'>def</span> <span class='id identifier rubyid_on_created_respond'>on_created_respond</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
443
515
|
<span class='ivar'>@on_created_respond_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
@@ -452,9 +524,9 @@
|
|
|
452
524
|
</div>
|
|
453
525
|
|
|
454
526
|
<div id="footer">
|
|
455
|
-
Generated on
|
|
527
|
+
Generated on Thu Jun 4 20:37:17 2026 by
|
|
456
528
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
457
|
-
0.9.34 (ruby-3.
|
|
529
|
+
0.9.34 (ruby-3.4.9).
|
|
458
530
|
</div>
|
|
459
531
|
|
|
460
532
|
</div>
|
|
@@ -755,9 +755,9 @@
|
|
|
755
755
|
</div>
|
|
756
756
|
|
|
757
757
|
<div id="footer">
|
|
758
|
-
Generated on
|
|
758
|
+
Generated on Thu Jun 4 20:37:18 2026 by
|
|
759
759
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
760
|
-
0.9.34 (ruby-3.
|
|
760
|
+
0.9.34 (ruby-3.4.9).
|
|
761
761
|
</div>
|
|
762
762
|
|
|
763
763
|
</div>
|