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
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
<h2>
|
|
139
|
-
|
|
139
|
+
DSL
|
|
140
140
|
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
141
141
|
</h2>
|
|
142
142
|
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
<li class="public ">
|
|
146
146
|
<span class="summary_signature">
|
|
147
147
|
|
|
148
|
-
<a href="#on_destroyed-instance_method" title="#on_destroyed (instance method)">#<strong>on_destroyed</strong>
|
|
148
|
+
<a href="#on_destroyed-instance_method" title="#on_destroyed (instance method)">#<strong>on_destroyed</strong> { ... } ⇒ void </a>
|
|
149
149
|
|
|
150
150
|
|
|
151
151
|
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
|
|
161
161
|
|
|
162
162
|
<span class="summary_desc"><div class='inline'>
|
|
163
|
-
<p>DSL method Sets
|
|
163
|
+
<p>DSL method Sets an optional hook evaluated (with backfire) after a successful destroy but before responding.</p>
|
|
164
164
|
</div></span>
|
|
165
165
|
|
|
166
166
|
</li>
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
<li class="public ">
|
|
170
170
|
<span class="summary_signature">
|
|
171
171
|
|
|
172
|
-
<a href="#on_destroyed_redirect_path-instance_method" title="#on_destroyed_redirect_path (instance method)">#<strong>on_destroyed_redirect_path</strong>
|
|
172
|
+
<a href="#on_destroyed_redirect_path-instance_method" title="#on_destroyed_redirect_path (instance method)">#<strong>on_destroyed_redirect_path</strong> { ... } ⇒ void </a>
|
|
173
173
|
|
|
174
174
|
|
|
175
175
|
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
|
|
185
185
|
|
|
186
186
|
<span class="summary_desc"><div class='inline'>
|
|
187
|
-
<p>DSL method.</p>
|
|
187
|
+
<p>DSL method Overrides the redirect target used by the default <span class='object_link'><a href="#on_destroyed_respond-instance_method" title="Compony::Components::Destroy#on_destroyed_respond (method)">#on_destroyed_respond</a></span> (keeping the default flash).</p>
|
|
188
188
|
</div></span>
|
|
189
189
|
|
|
190
190
|
</li>
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
<li class="public ">
|
|
194
194
|
<span class="summary_signature">
|
|
195
195
|
|
|
196
|
-
<a href="#on_destroyed_respond-instance_method" title="#on_destroyed_respond (instance method)">#<strong>on_destroyed_respond</strong>
|
|
196
|
+
<a href="#on_destroyed_respond-instance_method" title="#on_destroyed_respond (instance method)">#<strong>on_destroyed_respond</strong> { ... } ⇒ void </a>
|
|
197
197
|
|
|
198
198
|
|
|
199
199
|
|
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
|
|
209
209
|
|
|
210
210
|
<span class="summary_desc"><div class='inline'>
|
|
211
|
-
<p>DSL method.</p>
|
|
211
|
+
<p>DSL method Overrides the response issued after a successful destroy.</p>
|
|
212
212
|
</div></span>
|
|
213
213
|
|
|
214
214
|
</li>
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
<div class="method_details first">
|
|
250
250
|
<h3 class="signature first" id="on_destroyed-instance_method">
|
|
251
251
|
|
|
252
|
-
#<strong>on_destroyed</strong>
|
|
252
|
+
#<strong>on_destroyed</strong> { ... } ⇒ <tt>void</tt>
|
|
253
253
|
|
|
254
254
|
|
|
255
255
|
|
|
@@ -257,14 +257,32 @@
|
|
|
257
257
|
|
|
258
258
|
</h3><div class="docstring">
|
|
259
259
|
<div class="discussion">
|
|
260
|
-
|
|
261
|
-
<p>DSL method Sets
|
|
260
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
261
|
+
<p>DSL method Sets an optional hook evaluated (with backfire) after a successful destroy but before responding. Suitable for post-destroy side effects (like an <code>after_destroy</code> that only fires when this component destroyed the record). Do not redirect or render here - use <span class='object_link'><a href="#on_destroyed_respond-instance_method" title="Compony::Components::Destroy#on_destroyed_respond (method)">#on_destroyed_respond</a></span> / <span class='object_link'><a href="#on_destroyed_redirect_path-instance_method" title="Compony::Components::Destroy#on_destroyed_redirect_path (method)">#on_destroyed_redirect_path</a></span> for that.</p>
|
|
262
262
|
|
|
263
263
|
|
|
264
264
|
</div>
|
|
265
265
|
</div>
|
|
266
266
|
<div class="tags">
|
|
267
267
|
|
|
268
|
+
<p class="tag_title">Yields:</p>
|
|
269
|
+
<ul class="yield">
|
|
270
|
+
|
|
271
|
+
<li>
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
<span class='type'></span>
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
<div class='inline'>
|
|
280
|
+
<p>Runs in the component’s request context after <code>@data</code> was destroyed.</p>
|
|
281
|
+
</div>
|
|
282
|
+
|
|
283
|
+
</li>
|
|
284
|
+
|
|
285
|
+
</ul>
|
|
268
286
|
|
|
269
287
|
</div><table class="source_code">
|
|
270
288
|
<tr>
|
|
@@ -272,12 +290,12 @@
|
|
|
272
290
|
<pre class="lines">
|
|
273
291
|
|
|
274
292
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
293
|
+
90
|
|
294
|
+
91
|
|
295
|
+
92</pre>
|
|
278
296
|
</td>
|
|
279
297
|
<td>
|
|
280
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/destroy.rb', line
|
|
298
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/destroy.rb', line 90</span>
|
|
281
299
|
|
|
282
300
|
<span class='kw'>def</span> <span class='id identifier rubyid_on_destroyed'>on_destroyed</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
283
301
|
<span class='ivar'>@on_destroyed_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
@@ -290,7 +308,7 @@
|
|
|
290
308
|
<div class="method_details ">
|
|
291
309
|
<h3 class="signature " id="on_destroyed_redirect_path-instance_method">
|
|
292
310
|
|
|
293
|
-
#<strong>on_destroyed_redirect_path</strong>
|
|
311
|
+
#<strong>on_destroyed_redirect_path</strong> { ... } ⇒ <tt>void</tt>
|
|
294
312
|
|
|
295
313
|
|
|
296
314
|
|
|
@@ -298,14 +316,32 @@
|
|
|
298
316
|
|
|
299
317
|
</h3><div class="docstring">
|
|
300
318
|
<div class="discussion">
|
|
301
|
-
|
|
302
|
-
<p>DSL method</p>
|
|
319
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
320
|
+
<p>DSL method Overrides the redirect target used by the default <span class='object_link'><a href="#on_destroyed_respond-instance_method" title="Compony::Components::Destroy#on_destroyed_respond (method)">#on_destroyed_respond</a></span> (keeping the default flash). Defaults to the owner’s Show (if owned) or the data’s Index.</p>
|
|
303
321
|
|
|
304
322
|
|
|
305
323
|
</div>
|
|
306
324
|
</div>
|
|
307
325
|
<div class="tags">
|
|
308
326
|
|
|
327
|
+
<p class="tag_title">Yields:</p>
|
|
328
|
+
<ul class="yield">
|
|
329
|
+
|
|
330
|
+
<li>
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
<span class='type'></span>
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
<div class='inline'>
|
|
339
|
+
<p>Runs in the component’s request context; expected to return a Rails path (e.g. via <code>Compony.path</code>).</p>
|
|
340
|
+
</div>
|
|
341
|
+
|
|
342
|
+
</li>
|
|
343
|
+
|
|
344
|
+
</ul>
|
|
309
345
|
|
|
310
346
|
</div><table class="source_code">
|
|
311
347
|
<tr>
|
|
@@ -313,12 +349,12 @@
|
|
|
313
349
|
<pre class="lines">
|
|
314
350
|
|
|
315
351
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
352
|
+
111
|
|
353
|
+
112
|
|
354
|
+
113</pre>
|
|
319
355
|
</td>
|
|
320
356
|
<td>
|
|
321
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/destroy.rb', line
|
|
357
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/destroy.rb', line 111</span>
|
|
322
358
|
|
|
323
359
|
<span class='kw'>def</span> <span class='id identifier rubyid_on_destroyed_redirect_path'>on_destroyed_redirect_path</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
324
360
|
<span class='ivar'>@on_destroyed_redirect_path_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
@@ -331,7 +367,7 @@
|
|
|
331
367
|
<div class="method_details ">
|
|
332
368
|
<h3 class="signature " id="on_destroyed_respond-instance_method">
|
|
333
369
|
|
|
334
|
-
#<strong>on_destroyed_respond</strong>
|
|
370
|
+
#<strong>on_destroyed_respond</strong> { ... } ⇒ <tt>void</tt>
|
|
335
371
|
|
|
336
372
|
|
|
337
373
|
|
|
@@ -339,14 +375,32 @@
|
|
|
339
375
|
|
|
340
376
|
</h3><div class="docstring">
|
|
341
377
|
<div class="discussion">
|
|
342
|
-
|
|
343
|
-
<p>DSL method</p>
|
|
378
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
379
|
+
<p>DSL method Overrides the response issued after a successful destroy. The default shows a flash and redirects to <span class='object_link'><a href="#on_destroyed_redirect_path-instance_method" title="Compony::Components::Destroy#on_destroyed_redirect_path (method)">#on_destroyed_redirect_path</a></span> with HTTP 303 (forces a GET, required for Turbo). If you override this, <span class='object_link'><a href="#on_destroyed_redirect_path-instance_method" title="Compony::Components::Destroy#on_destroyed_redirect_path (method)">#on_destroyed_redirect_path</a></span> is no longer called.</p>
|
|
344
380
|
|
|
345
381
|
|
|
346
382
|
</div>
|
|
347
383
|
</div>
|
|
348
384
|
<div class="tags">
|
|
349
385
|
|
|
386
|
+
<p class="tag_title">Yields:</p>
|
|
387
|
+
<ul class="yield">
|
|
388
|
+
|
|
389
|
+
<li>
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
<span class='type'></span>
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
<div class='inline'>
|
|
398
|
+
<p>Runs in the component’s request context; expected to render or redirect.</p>
|
|
399
|
+
</div>
|
|
400
|
+
|
|
401
|
+
</li>
|
|
402
|
+
|
|
403
|
+
</ul>
|
|
350
404
|
|
|
351
405
|
</div><table class="source_code">
|
|
352
406
|
<tr>
|
|
@@ -354,12 +408,12 @@
|
|
|
354
408
|
<pre class="lines">
|
|
355
409
|
|
|
356
410
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
411
|
+
101
|
|
412
|
+
102
|
|
413
|
+
103</pre>
|
|
360
414
|
</td>
|
|
361
415
|
<td>
|
|
362
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/destroy.rb', line
|
|
416
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/destroy.rb', line 101</span>
|
|
363
417
|
|
|
364
418
|
<span class='kw'>def</span> <span class='id identifier rubyid_on_destroyed_respond'>on_destroyed_respond</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
365
419
|
<span class='ivar'>@on_destroyed_respond_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
@@ -374,7 +428,7 @@
|
|
|
374
428
|
</div>
|
|
375
429
|
|
|
376
430
|
<div id="footer">
|
|
377
|
-
Generated on
|
|
431
|
+
Generated on Mon May 18 13:55:36 2026 by
|
|
378
432
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
379
433
|
0.9.34 (ruby-3.3.5).
|
|
380
434
|
</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_update_failed-instance_method" title="#on_update_failed (instance method)">#<strong>on_update_failed</strong>
|
|
150
|
+
<a href="#on_update_failed-instance_method" title="#on_update_failed (instance method)">#<strong>on_update_failed</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 update failed (<code>@update_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_updated-instance_method" title="#on_updated (instance method)">#<strong>on_updated</strong>
|
|
174
|
+
<a href="#on_updated-instance_method" title="#on_updated (instance method)">#<strong>on_updated</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 update 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_updated_redirect_path-instance_method" title="#on_updated_redirect_path (instance method)">#<strong>on_updated_redirect_path</strong>
|
|
198
|
+
<a href="#on_updated_redirect_path-instance_method" title="#on_updated_redirect_path (instance method)">#<strong>on_updated_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_updated_respond-instance_method" title="Compony::Components::Edit#on_updated_respond (method)">#on_updated_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_updated_respond-instance_method" title="#on_updated_respond (instance method)">#<strong>on_updated_respond</strong>
|
|
222
|
+
<a href="#on_updated_respond-instance_method" title="#on_updated_respond (instance method)">#<strong>on_updated_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 update.</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_update_failed-instance_method">
|
|
288
288
|
|
|
289
|
-
#<strong>on_update_failed</strong>
|
|
289
|
+
#<strong>on_update_failed</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 update failed (<code>@update_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
|
+
132
|
|
331
|
+
133
|
|
332
|
+
134</pre>
|
|
315
333
|
</td>
|
|
316
334
|
<td>
|
|
317
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/edit.rb', line
|
|
335
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/edit.rb', line 132</span>
|
|
318
336
|
|
|
319
337
|
<span class='kw'>def</span> <span class='id identifier rubyid_on_update_failed'>on_update_failed</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_update_failed_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_updated-instance_method">
|
|
329
347
|
|
|
330
|
-
#<strong>on_updated</strong>
|
|
348
|
+
#<strong>on_updated</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 update but before responding. Suitable for post-update side effects (like an <code>after_update</code> that only fires when this component updated the record). Do not redirect or render here - use <span class='object_link'><a href="#on_updated_respond-instance_method" title="Compony::Components::Edit#on_updated_respond (method)">#on_updated_respond</a></span> / <span class='object_link'><a href="#on_updated_redirect_path-instance_method" title="Compony::Components::Edit#on_updated_redirect_path (method)">#on_updated_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
|
+
102
|
|
390
|
+
103
|
|
391
|
+
104</pre>
|
|
356
392
|
</td>
|
|
357
393
|
<td>
|
|
358
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/edit.rb', line
|
|
394
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/edit.rb', line 102</span>
|
|
359
395
|
|
|
360
396
|
<span class='kw'>def</span> <span class='id identifier rubyid_on_updated'>on_updated</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_updated_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_updated_redirect_path-instance_method">
|
|
370
406
|
|
|
371
|
-
#<strong>on_updated_redirect_path</strong>
|
|
407
|
+
#<strong>on_updated_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_updated_respond-instance_method" title="Compony::Components::Edit#on_updated_respond (method)">#on_updated_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
|
+
122
|
|
449
|
+
123
|
|
450
|
+
124</pre>
|
|
397
451
|
</td>
|
|
398
452
|
<td>
|
|
399
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/edit.rb', line
|
|
453
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/edit.rb', line 122</span>
|
|
400
454
|
|
|
401
455
|
<span class='kw'>def</span> <span class='id identifier rubyid_on_updated_redirect_path'>on_updated_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_updated_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_updated_respond-instance_method">
|
|
411
465
|
|
|
412
|
-
#<strong>on_updated_respond</strong>
|
|
466
|
+
#<strong>on_updated_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 update. The default shows a flash and redirects to <span class='object_link'><a href="#on_updated_redirect_path-instance_method" title="Compony::Components::Edit#on_updated_redirect_path (method)">#on_updated_redirect_path</a></span>. If you override this, <span class='object_link'><a href="#on_updated_redirect_path-instance_method" title="Compony::Components::Edit#on_updated_redirect_path (method)">#on_updated_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
|
+
112
|
|
508
|
+
113
|
|
509
|
+
114</pre>
|
|
438
510
|
</td>
|
|
439
511
|
<td>
|
|
440
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/edit.rb', line
|
|
512
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/edit.rb', line 112</span>
|
|
441
513
|
|
|
442
514
|
<span class='kw'>def</span> <span class='id identifier rubyid_on_updated_respond'>on_updated_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_updated_respond_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
@@ -452,7 +524,7 @@
|
|
|
452
524
|
</div>
|
|
453
525
|
|
|
454
526
|
<div id="footer">
|
|
455
|
-
Generated on
|
|
527
|
+
Generated on Mon May 18 13:55:35 2026 by
|
|
456
528
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
457
529
|
0.9.34 (ruby-3.3.5).
|
|
458
530
|
</div>
|